-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
64 lines (49 loc) · 1.4 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
## Copyright 2011 and onwards
## Author: [email protected] (Danny Tarlow)
## 12/01/2011
##
## Makefile for graph cuts neural network component
#CC = icpc
#LD = icpc
CC = g++
LD = g++
## external .h files to bring in
EXTRA_INCLUDES =
# Danny's laptop
#CCFLAGS = -g -Wall -Wno-deprecated -fPIC
#LDFLAGS =
#DYLIB_CMD = -dynamiclib -fPIC
# Toronto clusters
#CCFLAGS = -g -Wall -Wno-deprecated -I/u/dtarlow/lib/include/ -I/u/dtarlow/workspace/lib/include/ -fPIC
#LDFLAGS = -lm -L/u/dtarlow/lib/lib/ -L/u/dtarlow/workspace/lib/lib/ -lboost_program_options
# My linux box
CCFLAGS = -g -Wall -Wno-deprecated -fPIC
LDFLAGS = -lm
DYLIB_CMD = -fPIC -shared
## sources
PROGFILE = chain_alg.cpp
CCFILES =
## object compilation
PROGOBJS = $(CCFILES:.cpp=.o) $(PROGFILE:.cpp=.o)
# lib compilation
CHAINLIB = chain_alg.A.dylib
#CARDLIB = cardprop.A.dylib
## binary compilation
PROG = chain
all:
@echo "-> Compiling utils and external sources..."
@make chain_alg.o
@echo "-> Building $(PROG) executable..."
@make $(PROG)
@echo "-> Building $(CHAINLIB) lib..."
@make $(CHAINLIB)
@echo
chain_alg.o: chain_alg.cpp
$(CC) $(CCFLAGS) $(EXTRA_INCLUDES) -c chain_alg.cpp
$(PROG): $(PROGOBJS)
$(LD) $(LDFLAGS) $(PROGOBJS) -o $(PROG) $(CCFLAGS) $(LDFLAGS) $(CARBON_FLAGS)
$(CHAINLIB): $(PROGOBJS)
$(LD) $(DYLIB_CMD) $(PROGOBJS) $(LDFLAGS) -o $(CHAINLIB)
clean:
@echo "-> Cleaning..."
rm -f .cpp.o $(PROG) $(PROGOBJS) $(GCLIB)