-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile-orig-07-07-01-2
49 lines (33 loc) · 1.23 KB
/
Makefile-orig-07-07-01-2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#makefile for c++ programs
#change the name of the executable to use for "any" project
EXECUTABLE = ../bin/tandem.exe
#EXECUTABLE = ../bin/p3.exe
LINKCC = $(CXX)
#CXXFLAGS denotes flags for the C++ compiler
CXX = g++
CXXFLAGS = -O2 -DGCC -DPLUGGABLE_SCORING
#CXXFLAGS = -O2 -DGCC -DPLUGGABLE_SCORING -DX_P3
LDFLAGS = -lpthread -L/usr/lib -lm -lexpat
SRCS := $(wildcard *.cpp)
OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
DEPS := $(patsubst %.o,%.d,$(OBJS))
all: $(EXECUTABLE)
#define the components of the program, and how to link them
#these components are defined as dependencies; that is they must be up-to-date before the code is linked
$(EXECUTABLE): $(DEPS) $(OBJS)
$(LINKCC) $(LDFLAGS) $(CXXFLAGS) -o $(EXECUTABLE) $(OBJS)
#specify the dep files depend on the cpp files
%.d: %.cpp
$(CXX) -M $(CXXFLAGS) $< > $@
$(CXX) -M $(CXXFLAGS) $< | sed s/\\.o/.d/ > $@
clean:
-rm $(OBJS) $(EXECUTABLE) $(DEPS) *~
explain:
@echo "The following info represents the program:"
@echo "Final exec name: $(EXECUTABLE)"
@echo "Source files: $(SRCS)"
@echo "Object files: $(OBJS)"
@echo "Dep files: $(DEPS)"
depend: $(DEPS)
@echo "Deps are now up-to-date."
-include $(DEPS)