From: David Gow Date: Wed, 26 Mar 2014 08:29:53 +0000 (+0800) Subject: Some makefile changes X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=5cc867d6c8c7ca9d977e015de12c961f4067ecec;p=ipdf%2Fcode.git Some makefile changes --- diff --git a/src/Makefile b/src/Makefile index 39f09ef..8e44ac0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,32 +1,32 @@ #Makefile CXX = g++ -std=gnu++0x -Wall -Werror -Wshadow -pedantic -g -OBJ = log.o +OBJ = log.o main.o LIB = #-lSDL2 -DEPS := $(OBJ:%.o=%.d) +OBJPATHS = $(OBJ:%=../obj/%) +DEPS := $(OBJPATHS:%.o=%.d) -LINKOBJ = $(OBJ) +LINKOBJ = $(OBJPATHS) RM = rm -f -BIN = ipdf +BIN = ../bin/ipdf + +-include $(DEPS) 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 $@ $< -no_main : $(OBJ) - -main.o : main.cpp - $(CXX) -c main.cpp - clean : - $(RM) $(BIN) $(OBJ) $(LINKOBJ) main.o + $(RM) $(BIN) $(DEPS) $(LINKOBJ) clean_full: #cleans up all backup files - $(RM) $(BIN) $(OBJ) $(LINKOBJ) + $(RM) $(BIN) $(DEPS) $(LINKOBJ) $(RM) *.*~ $(RM) *~ $(RM) *.o diff --git a/src/ipdf b/src/ipdf deleted file mode 100755 index e6be120..0000000 Binary files a/src/ipdf and /dev/null differ