git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some makefile changes
[ipdf/code.git]
/
src
/
Makefile
diff --git
a/src/Makefile
b/src/Makefile
index
39f09ef
..
8e44ac0
100644
(file)
--- a/
src/Makefile
+++ b/
src/Makefile
@@
-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 = $(OBJ
PATHS
)
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
UCC
git Repository :: git.ucc.asn.au