-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
93 lines (68 loc) · 1.61 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
89
90
91
92
93
EXECS = ecc random-graph gnmp
SOURCES = \
Util.ml \
IntMap.ml \
IntSet.ml \
PSQueue.ml \
Graph.ml \
Cliques.ml \
ECC.ml \
Branch.ml \
Sweep.ml \
KSW.ml \
InsertAbsorb.ml
C_SOURCES = \
INCLUDES = #-I extlib-dev
LIBS = unix.cmxa
CC = gcc
OCAMLC = ocamlc -g $(INCLUDES)
OCAMLOPT = ocamlopt $(INCLUDES)
OCAMLDEP = ocamldep $(INCLUDES)
#PROFILE = -p
CFLAGS = -std=c99 -g -I $(HOME)/include
CFLAGS += -O3 $(shell gcc-arch) $(PROFILE) -funroll-all-loops -ffast-math
CFLAGS += -W -Wall -Wno-unused
#CFLAGS += -DNDEBUG
all: depend $(EXECS) doc/index.html
OBJS = $(SOURCES:.ml=.cmx)
DBG_OBJS = $(SOURCES:.ml=.cmo)
C_OBJS = $(C_SOURCES:.c=.o)
MLIS := $(wildcard *.mli)
DBG_LIBS = $(LIBS:.cmxa=.cma)
ecc: $(OBJS) Main.cmx
$(OCAMLOPT) $(PROFILE) -o $@ $(LIBS) $^
ecc-dbg: $(DBG_OBJS) Main.cmo $(C_OBJS)
$(OCAMLC) $(PROFILE) -o $@ $(DBG_LIBS) $^
random-graph: $(OBJS) RandomGraph.cmx
$(OCAMLOPT) $(PROFILE) -o $@ $(LIBS) $^
gnmp: $(OBJS) Gnmp.cmx
$(OCAMLOPT) $(PROFILE) -o $@ $(LIBS) $^
doc/index.html: $(MLIS)
mkdir -p doc
ocamldoc -html -d doc $^
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.ml.cmo:
$(OCAMLC) -c $<
.mli.cmi:
$(OCAMLC) -c $<
.ml.cmx:
$(OCAMLOPT) $(PROFILE) -c $<
VER = 1.1
DIR = ecc-$(VER)
dist: all
rm -rf $(DIR)
mkdir $(DIR)
cp COPYING README $(DIR)
cp .depend $(DIR)
cp Makefile *.ml *.mli $(DIR)
GZIP=--best tar -cvvzf $(DIR).tar.gz $(DIR)
clean:
rm -f $(EXECS) ecc-dbg core gmon.out
rm -f *.cm[iox] *.o $(PROJ)
realclean: clean
rm -f *~ *.old *.bak
.depend: depend
depend: $(SOURCES)
$(OCAMLDEP) *.mli *.ml > .depend
# $(CC) $(CFLAGS) -MM *.c >> .depend
include .depend