-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new makefile! faster and better. no need to recompile over and over a…
…gain. just check howto in file. also I added an int casting inside page.cpp
- Loading branch information
Showing
5 changed files
with
47 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
int main(int argc, char *argv[]) | ||
{ | ||
jce *curr_user = new jce(); | ||
jce curr_user; | ||
while (true); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
#ifndef MAIN_H | ||
#define MAIN_H | ||
|
||
//#include "socket.h" | ||
#include "jce.h" | ||
//#define dst_host "www.google.co.il" | ||
//#define dst_port 443 | ||
|
||
// #define dst_host "yedion.jce.ac.il" | ||
// #define dst_port 443 | ||
|
||
#endif // MAIN_H | ||
#endif // MAIN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,54 @@ | ||
|
||
#HOW-TO: | ||
# make to compile | ||
# make clean cleaning objects directory | ||
# make bclean cleaning all files | ||
# make rebuild clean and remake | ||
|
||
# compiler | ||
CC=g++ | ||
|
||
# compile arguments | ||
CFLAGS+= -Wall -g -fexceptions -std=c++11 -D_REENTRANT -pthread | ||
CFLAGS = -Wall -g -fexceptions -std=c++11 -D_REENTRANT -pthread | ||
|
||
# linker flags | ||
LDFLAGS+= -g -std=c++11 | ||
LDFLAGS = -g -std=c++11 | ||
|
||
# libraries | ||
LIBS+= -lcrypto -lssl | ||
LIBS = -lcrypto -lssl | ||
|
||
# our source files | ||
SOURCES=main.cpp socket.cpp sslsocket.cpp jce.cpp Page.cpp user.cpp GradePage.cpp GradePage.h Course.cpp Course.h | ||
#our source files | ||
SOURCES=$(wildcard *.cpp) | ||
|
||
# a macro to define the objects from sources | ||
OBJECTS=$(SOURCES:.c=.o) | ||
BUILD_DIR := build | ||
OBJC=$(SOURCES:%.cpp=${BUILD_DIR}/%.o) | ||
|
||
# executable name | ||
EXECUTABLE=jce | ||
|
||
$(EXECUTABLE): $(OBJECTS) | ||
.PHONY: all | ||
|
||
all: $(EXECUTABLE) | ||
|
||
$(EXECUTABLE): $(OBJC) | ||
@echo "Building target" $@ "..." | ||
$(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS) | ||
@echo "Done!" | ||
|
||
@$(CC) $(LDFLAGS) -o $@ $(OBJC) $(LIBS) | ||
|
||
# a rule for generating object files given their c files | ||
.c.o: | ||
@echo "Compiling" $< "..." | ||
$(CC) $(CFLAGS) $< -o $@ | ||
@echo "Done!" | ||
#.cpp.o: /$(OBJCDIR) | ||
${BUILD_DIR}/%.o: %.cpp | ||
@mkdir -p $(dir $@) | ||
@$(CC) $(CFLAGS) -c $< -o $@ | ||
|
||
clean: | ||
@echo "Ceaning up *.o Files..." | ||
rm -rf *s *o $(EXECUTABLE) | ||
@echo "Done!" | ||
@rm -rf ${BUILD_DIR} | ||
|
||
bclean: | ||
@echo "Ceaning all" | ||
@rm -rf $(EXECUTABLE) ${BUILD_DIR} | ||
|
||
rebuild: clean all | ||
|
||
|
||
.PHONY: all clean |