-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
77 lines (58 loc) · 1.39 KB
/
Makefile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Define executable name
BIN = build/test
# Define source files
CPP_SRCS = src/common.cpp\
src/sensor.cpp\
src/sysmodelparser.cpp\
src/observer.cpp\
src/main.cpp
# Define header file paths
INCPATH = -Ihdr/
# Define the -L library path(s)
LDFLAGS =
# Define the -l library name(s)
LIBS = /usr/local/lib/libmuparserd.so -lrt
# Only in special cases should anything be edited below this line
OBJS = $(CPP_SRCS:.cpp=.o)
CXXFLAGS = -c -Wall -ansi -pedantic
DEP_FILE = .depend
.PHONY = all clean distclean
# Main entry point
#
all: depend $(BIN)
# For linking object file(s) to produce the executable
#
$(BIN): $(OBJS)
@echo Linking $@
@$(CXX) $^ $(LDFLAGS) $(LIBS) -o $@
# For compiling source file(s)
#
.cpp.o:
@echo Compiling $<
@$(CXX) $(CXXFLAGS) $(INCPATH) $< -o $@
# For cleaning up the project
#
clean:
$(RM) $(OBJS)
distclean: clean
$(RM) $(BIN)
$(RM) $(DEP_FILE)
# For documenting
#
doc:
doxygen docs/doxy_config ; cd latex ; sh docs/fixtex.sh ; $(MAKE)
mv -f src/latex/refman.pdf src/html docs/
mv -f src/html docs/
$(RM) src/latex src/html
# For determining source file dependencies
#
depend: $(DEP_FILE)
@touch $(DEP_FILE)
$(DEP_FILE):
@echo Generating dependencies in $@
@-$(CXX) -E -MM $(CXXFLAGS) $(INCPATH) $(CPP_SRCS) >> $(DEP_FILE)
ifeq (,$(findstring clean,$(MAKECMDGOALS)))
ifeq (,$(findstring distclean,$(MAKECMDGOALS)))
-include $(DEP_FILE)
endif
endif