summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 3358d26792367b2391ff761bff994227ef177e54 (plain)
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
CC   := gcc
CXX  := g++ 
LD   := g++
CP   := cp

PROG := abc

MODULES := src/base/abc src/base/cmd src/base/io src/base/main \
           src/bdd/cudd src/bdd/dsd src/bdd/epd src/bdd/mtr src/bdd/parse src/bdd/reo \
           src/map/fpga src/map/mapper src/map/mio src/map/super \
           src/misc/extra src/misc/st src/misc/util src/misc/vec \
	   src/opt/fxu src/opt/rwr \
           src/sat/asat src/sat/fraig src/sat/msat src/sat/sim \
           src/seq \
           src/sop/ft src/sop/mvc

default: $(PROG)

CFLAGS   += -Wall -Wno-unused-function -g -O $(patsubst %, -I%, $(MODULES)) 
CXXFLAGS += $(CFLAGS) 

LIBS := 
SRC  := 
GARBAGE := core core.* *.stackdump ./tags $(PROG)

.PHONY: tags clean docs

include $(patsubst %, %/module.make, $(MODULES))

OBJ := \
	$(patsubst %.cc, %.o, $(filter %.cc, $(SRC))) \
	$(patsubst %.c, %.o,  $(filter %.c, $(SRC)))  \
	$(patsubst %.y, %.o,  $(filter %.y, $(SRC))) 

DEP := $(OBJ:.o=.d)

# implicit rules

%.d: %.c
	./depends.sh $(CC) `dirname $*.c` $(CFLAGS) $*.c > $@

%.d: %.cc
	./depends.sh $(CXX) `dirname $*.cc` $(CXXFLAGS) $(CFLAGS) $*.cc > $@

-include $(DEP)

# Actual targets

depend: $(DEP)

clean: 
	rm -rf $(PROG) $(OBJ) $(GARBAGE) $(OBJ:.o=.d) 

tags:
	ctags -R .

$(PROG): $(OBJ)
	$(LD) -o $@ $^ $(LIBS)

docs:
	doxygen doxygen.conf