Revision ee0dd796 custompackages/graph-parser/src/Makefile

View differences:

custompackages/graph-parser/src/Makefile
2 2
# Makefile for hello-boost-graph program
3 3
##############################################
4 4

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

  
7
main: main.o
8
	$(CXX) $(LDFLAGS) main.o -o ../bin/main
7
# define the C source files
8
SRCS = main.cpp bi_connected_components.cpp centrality.cpp parser.cpp sub_component.cpp utility.cpp
9 9

  
10
main.o: main.cpp
11
	$(CXX) $(CXXFLAGS) -I $(BOOST_ROOT) -std=c++11 -c main.cpp $(LIBS)
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

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

  
26
$(MAIN): $(OBJS)
27
	$(CXX) $(CFLAGS) $(INCLUDES) -o ../bin/$(MAIN) $(OBJS) $(LFLAGS) $(LIBS )
28

  
29
# this is a suffix replacement rule for building .o's from .c's
30
# it uses automatic variables $<: the name of the prerequisite of
31
# the rule(a .c file) and $@: the name of the target of the rule (a .o file)
32
# (see the gnu make manual section about automatic variables)
33
.cpp.o:
34
	$(CXX) $(CFLAGS) $(INCLUDES) -std=c++11 -c $<  -o $@
12 35

  
13 36
# remove object files and executable when user executes "make clean"
14 37
clean:
15
	rm *.o ./bin/main
38
	$(RM) *.o ../bin/$(MAIN)

Also available in: Unified diff