Some makefile changes
authorDavid Gow <[email protected]>
Wed, 26 Mar 2014 08:29:53 +0000 (16:29 +0800)
committerDavid Gow <[email protected]>
Wed, 26 Mar 2014 08:29:53 +0000 (16:29 +0800)
src/Makefile
src/ipdf [deleted file]

index 39f09ef..8e44ac0 100644 (file)
@@ -1,32 +1,32 @@
 #Makefile
 CXX = g++ -std=gnu++0x -Wall -Werror -Wshadow -pedantic -g
 #Makefile
 CXX = g++ -std=gnu++0x -Wall -Werror -Wshadow -pedantic -g
-OBJ = log.o
+OBJ = log.o main.o
 LIB = #-lSDL2
 LIB = #-lSDL2
-DEPS := $(OBJ:%.o=%.d)
+OBJPATHS = $(OBJ:%=../obj/%)
+DEPS := $(OBJPATHS:%.o=%.d)
 
 
-LINKOBJ = $(OBJ)
+LINKOBJ = $(OBJPATHS)
 
 RM = rm -f
 
 RM = rm -f
-BIN = ipdf
+BIN = ../bin/ipdf
+
+-include $(DEPS)
 
 all : $(BIN)
 
 
 all : $(BIN)
 
-$(BIN) : $(LINKOBJ) main.o
-       $(CXX) -o $(BIN) main.o $(LINKOBJ) $(LIB)
+$(BIN) : $(LINKOBJ)
+       @mkdir -p $(dir $@)
+       $(CXX) -o $(BIN) $(LINKOBJ) $(LIB)
 
 
-%.o : %.cpp
+../obj/%.o : %.cpp
+       @mkdir -p $(dir $@)
        $(CXX) -c -MMD -o $@ $<
 
        $(CXX) -c -MMD -o $@ $<
 
-no_main : $(OBJ)
-
-main.o : main.cpp
-       $(CXX) -c main.cpp
-
 clean :
 clean :
-       $(RM) $(BIN) $(OBJ) $(LINKOBJ) main.o
+       $(RM) $(BIN) $(DEPS) $(LINKOBJ)
 
 clean_full: #cleans up all backup files
 
 clean_full: #cleans up all backup files
-       $(RM) $(BIN) $(OBJ) $(LINKOBJ)
+       $(RM) $(BIN) $(DEPS) $(LINKOBJ)
        $(RM) *.*~
        $(RM) *~
        $(RM) *.o
        $(RM) *.*~
        $(RM) *~
        $(RM) *.o
diff --git a/src/ipdf b/src/ipdf
deleted file mode 100755 (executable)
index e6be120..0000000
Binary files a/src/ipdf and /dev/null differ

UCC git Repository :: git.ucc.asn.au