root / custompackages / graph-parser / src / Makefile.mips @ 33e5ad95
History | View | Annotate | Download (1.33 KB)
1 | 1e73dd2a | Quynh PX Nguyen | ############################################## |
---|---|---|---|
2 | # Makefile for graph-parser program |
||
3 | # This Makefile is used with OpenWRT. Therefore |
||
4 | # no $INCLUDES is defined. |
||
5 | # The BGL will be linked with the BGL in OpenWRT |
||
6 | ############################################## |
||
7 | |||
8 | # define the C source files |
||
9 | 911d0520 | Quynh PX Nguyen | SRCS = bi_connected_components.cpp graph_manager.cpp parser.cpp sub_component.cpp utility.cpp |
10 | 1e73dd2a | Quynh PX Nguyen | |
11 | |||
12 | # define the C object files |
||
13 | # |
||
14 | # This uses Suffix Replacement within a macro: |
||
15 | # $(name:string1=string2) |
||
16 | # For each word in 'name' replace 'string1' with 'string2' |
||
17 | # Below we are replacing the suffix .c of all words in the macro SRCS |
||
18 | # with the .o suffix |
||
19 | # |
||
20 | OBJS = $(SRCS:.cpp=.o) |
||
21 | |||
22 | MAIN = main |
||
23 | BIN_FILE = graph-parser |
||
24 | |||
25 | 911d0520 | Quynh PX Nguyen | CFLAGS=-mips32 |
26 | 1e73dd2a | Quynh PX Nguyen | |
27 | 911d0520 | Quynh PX Nguyen | $(MAIN): $(MAIN).o simulation.o $(OBJS) |
28 | $(CXX) $(CFLAGS) $(MAIN).o $(OBJS) $(LFLAGS) -o $(BIN_FILE) |
||
29 | $(CXX) $(CFLAGS) simulation.o $(OBJS) $(LFLAGS) -o simulation |
||
30 | 1e73dd2a | Quynh PX Nguyen | |
31 | 911d0520 | Quynh PX Nguyen | # $(CXX) $(CFLAGS) $(MAIN).o $(OBJS) $(LFLAGS) -o $(BIN_FILE) |
32 | 1e73dd2a | Quynh PX Nguyen | # this is a suffix replacement rule for building .o's from .c's |
33 | # it uses automatic variables $<: the name of the prerequisite of |
||
34 | # the rule(a .c file) and $@: the name of the target of the rule (a .o file) |
||
35 | # (see the gnu make manual section about automatic variables) |
||
36 | .cpp.o: |
||
37 | $(CXX) $(CFLAGS) -std=c++11 -c $< -o $@ |
||
38 | |||
39 | # remove object files and executable when user executes "make clean" |
||
40 | clean: |
||
41 | $(RM) *.o $(BIN_FILE) |