Statistics
| Branch: | Revision:

root / custompackages / graph-parser / src / Makefile @ 1e73dd2a

History | View | Annotate | Download (1.2 KB)

1 af008982 Quynh PX Nguyen
##############################################
2
# Makefile for hello-boost-graph program
3
##############################################
4
5 ee0dd796 Quynh PX Nguyen
INCLUDES = -I/usr/local/boost/
6 af008982 Quynh PX Nguyen
7 ee0dd796 Quynh PX Nguyen
# define the C source files
8 d5b7a27f Quynh PX Nguyen
SRCS = main.cpp bi_connected_components.cpp graph_manager.cpp parser.cpp sub_component.cpp utility.cpp
9 af008982 Quynh PX Nguyen
10 ee0dd796 Quynh PX Nguyen
11
# define the C object files
12
#
13
# This uses Suffix Replacement within a macro:
14
#   $(name:string1=string2)
15
#         For each word in 'name' replace 'string1' with 'string2'
16
# Below we are replacing the suffix .c of all words in the macro SRCS
17
# with the .o suffix
18
#
19
OBJS = $(SRCS:.cpp=.o)
20
21
MAIN = main
22 1e73dd2a Quynh PX Nguyen
BIN_FILE = graph-parser
23 ee0dd796 Quynh PX Nguyen
24
# all: ../bin/$(MAIN)
25
# 	@echo  Simple compiler named main has been compiled
26
27
$(MAIN): $(OBJS)
28 1e73dd2a Quynh PX Nguyen
	$(CXX) $(CFLAGS) $(INCLUDES) -o $(BIN_FILE) $(OBJS) $(LFLAGS) $(LIBS )
29 ee0dd796 Quynh PX Nguyen
30
# this is a suffix replacement rule for building .o's from .c's
31
# it uses automatic variables $<: the name of the prerequisite of
32
# the rule(a .c file) and $@: the name of the target of the rule (a .o file)
33
# (see the gnu make manual section about automatic variables)
34
.cpp.o:
35
	$(CXX) $(CFLAGS) $(INCLUDES) -std=c++11 -c $<  -o $@
36 af008982 Quynh PX Nguyen
37
# remove object files and executable when user executes "make clean"
38
clean:
39 1e73dd2a Quynh PX Nguyen
	$(RM) *.o $(BIN_FILE)