-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·67 lines (47 loc) · 1.16 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
# Define executable name
BIN = hello-myo
# Define source files
SRCS = hello-myo.cpp
# Define header file paths
INCPATH = -I./
# Define the -L library path(s)
LDFLAGS = myo-sdk-win-0.9.0/lib/
# Define the -l library name(s)
LIBS =
# Only in special cases should anything be edited below this line
OBJS = $(CPP_SRCS:.cpp=.o)
CXXFLAGS = -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) -c $(CXXFLAGS) $(INCPATH) $<
# For cleaning up the project
#
clean:
$(RM) $(OBJS)
distclean: clean
$(RM) $(BIN)
$(RM) $(DEP_FILE)
# For determining source file dependencies
#
depend: $(DEP_FILE)
@touch $(DEP_FILE)
$(DEP_FILE):
@echo Generating dependencies in $@
@-$(CXX) -E -MM $(CXXFLAGS) $(INCPATH) $(SRCS) >> $(DEP_FILE)
ifeq (,$(findstring clean,$(MAKECMDGOALS)))
ifeq (,$(findstring distclean,$(MAKECMDGOALS)))
-include $(DEP_FILE)
endif
endif