Statistics
| Branch: | Revision:

root / custompackages / graph-parser / src / Makefile @ 6575aa2e

History | View | Annotate | Download (1.56 KB)

1
##############################################
2
# Makefile for hello-boost-graph program
3
##############################################
4

    
5
INCLUDES = -I/usr/local/boost/
6

    
7
# define the C source files
8
SRCS = bi_connected_components.cpp graph_manager.cpp parser.cpp sub_component.cpp utility.cpp
9

    
10

    
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
MAIN_BIN = graph-parser
23
SIMULATION = simulation
24

    
25
# all: ../bin/$(MAIN)
26
# 	@echo  Simple compiler named main has been compiled
27

    
28
$(MAIN): $(MAIN).o $(SIMULATION).o $(OBJS)
29
	$(CXX) $(CFLAGS) $(INCLUDES) -o $(MAIN_BIN) $(MAIN).o $(OBJS) $(LFLAGS) $(LIBS )
30
	$(CXX) $(CFLAGS) $(INCLUDES) -o $(SIMULATION) $(SIMULATION).o $(OBJS) $(LFLAGS) $(LIBS )
31

    
32

    
33
$(SIMULATION): $(SIMULATION).o $(OBJS)
34
	$(CXX) $(CFLAGS) $(INCLUDES) -o $(SIMULATION) $(SIMULATION).o $(OBJS) $(LFLAGS) $(LIBS )
35

    
36
countbcc: count_bcc.o $(OBJS)
37
	$(CXX) $(CFLAGS) $(INCLUDES) -o countbcc count_bcc.o $(OBJS) $(LFLAGS)
38

    
39
# this is a suffix replacement rule for building .o's from .c's
40
# it uses automatic variables $<: the name of the prerequisite of
41
# the rule(a .c file) and $@: the name of the target of the rule (a .o file)
42
# (see the gnu make manual section about automatic variables)
43
.cpp.o:
44
	$(CXX) $(CFLAGS) $(INCLUDES) -std=c++11 -c $<  -o $@
45

    
46
# remove object files and executable when user executes "make clean"
47
clean:
48
	$(RM) *.o $(BIN_FILE)