projects
/
trackerpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5342c4
)
change makefile and ignore .o file
author
Peng Li
<seudut@gmail.com>
Mon, 9 Jul 2018 16:01:00 +0000
(
00:01
+0800)
committer
Peng Li
<seudut@gmail.com>
Mon, 9 Jul 2018 16:01:00 +0000
(
00:01
+0800)
.gitignore
[new file with mode: 0644]
patch
|
blob
Makefile
patch
|
blob
|
history
diff --git a/.gitignore
b/.gitignore
new file mode 100644
(file)
index 0000000..
4fc836e
--- /dev/null
+++ b/
.gitignore
@@ -0,0
+1,2
@@
+src/*.o
+*.o
diff --git
a/Makefile
b/Makefile
index
47cf62e
..
cfc680f
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-1,7
+1,18
@@
-CC = g++
-CFLAGS += -Wall -std=c++11
+CC := g++
+CFLAGS := -Wall -std=c++11
+CPPLAGS += -Wall -std=c++11
+CXXLAGS += -Wall -std=c++11
-SRC = src/*.cpp main.cpp
+SRC := $(wildcard src/*.cpp *.cpp)
+OBJS := $(patsubst %.cpp,%.o, $(SRC))
-all:
- $(CC) $(CFLAGS) -o main $(SRC) -llog4cpp
+.PHONY: all clean
+all:$(OBJS)
+ $(CC) $(CFLAGS) -o main $(OBJS) -llog4cpp
+
+$(OBJS):%.o:%.cpp
+ $(CC) -c $(CFLAGS) $< -o $@
+
+
+clean:
+ rm -rf $(OBJS) main