-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
88 lines (63 loc) · 2.25 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# Makefile for libbvg
#
# David Gleich
# Copyright, Stanford University, 2008
# 4 February 2008
#
LIBBVGNAME := libbvg.a
LIBBVG_SRC_DIR := src
BVPAGERANKNAME := bvpr
LIBBVG_INCLUDE := -Iinclude -Isrc
LIBBVG_SRC := bitfile.c bvgraph.c bvgraph_iterator.c bvgraph_random.c \
bvgraphfun.c properties.c util.c eflist.c debug.c
LIBBVG_FULL_SRC := $(addprefix $(LIBBVG_SRC_DIR)/,$(LIBBVG_SRC))
BVPAGERANK_INCLUDE := -Iinclude
BVPAGERANK_SRC_DIR := tools/bvpagerank
CFLAGS := $(CFLAGS) -Wall -O2 -Wextra -Wno-unused-parameter -fPIC $(LIBBVG_INCLUDE)
CXXFLAGS := $(CXXFLAGS) -Wall -O2 -Iinclude
LOADLIBES += -L. -lbvg
all: everything
# use target specific variables for the debug option
# http://www.gnu.org/software/make/manual/make.html#Target%5F002dspecific
# http://stackoverflow.com/questions/1079832/how-can-i-configure-my-makefile-for-debug-and-release-builds
debug: CFLAGS += -DDEBUG=1
debug: lib
# declare phony targets
.PHONY: all lib clean everything python docs
#lib: $(LIBBVG_FULL_SRC)
#gcc -c $(LIBBVG_INCLUDE) $(CFLAGS) $(LIBBVG_FULL_SRC)
#ar -rcs $(LIBBVGNAME) $(LIBBVG_SRC:.c=.o)
lib: $(LIBBVGNAME)
$(LIBBVGNAME): $(LIBBVG_FULL_SRC:.c=.o)
ar -rcs $(LIBBVGNAME) $(LIBBVG_FULL_SRC:.c=.o)
clean:
$(RM) $(LIBBVG_FULL_SRC:.c=.o) $(LIBBVGNAME) $(ALLPROGS) $(ALLOBJS)
cd test && $(MAKE) clean
cd python && $(MAKE) clean
$(RM) -r html/docs doxyfile.inc
$(BVPAGERANKNAME): lib $(BVPAGERANK_SRC_DIR)/bvpagerank.o
$(CXX) $(LDFLAGS) $(BVPAGERANK_SRC_DIR)/bvpagerank.o -o $(BVPAGERANKNAME) $(LOADLIBES) $(LDLIBS)
ALLOBJS += $(BVPAGERANK_SRC_DIR)/bvpagerank.o
ALLPROGS += $(BVPAGERANKNAME)
bvgraph2smat : lib tools/bvgraph2smat/bvgraph2smat.o
$(CXX) $(LDFLAGS) -o bvgraph2smat tools/bvgraph2smat/bvgraph2smat.o $(LOADLIBES) $(LDLIBS)
ALLOBJS += tools/bvgraph2smat/bvgraph2smat.o
ALLPROGS += bvgraph2smat
everything: lib $(BVPAGERANKNAME) bvgraph2smat test python
test: lib
cd test && $(MAKE) small
testfull: lib
cd test && $(MAKE) testfull
python: lib
cd python && $(MAKE) all
SRCS := $(OBJS:.o=.c)
SRCDIRS := ./src
SRCDIRS += ./include
SRCDIRS += ./src/mainpage.dox
doxyfile.inc: $(SRCDIRS)
echo INPUT = $(SRCDIRS) > doxyfile.inc
echo FILE_PATTERNS = *.h *.c $(SRCS) >> doxyfile.inc
docs: doxyfile.inc $(SRCS)
mkdir -p html
doxygen doxyfile.mk