-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
76 lines (64 loc) · 1.81 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
# source codes to be compiled
SRCPKGS = cmd ntk alg stg ext io trans vrf dfx svr adt util v3mc
# library to be linked (should include SRCPKGS)
LIBPKGS = vrf dfx stg trans alg ext ntk io ntk svr cmd adt util v3mc
# engine header files and libraries to be soft linked
ENGPKGS += minisat
ENGPKGS += boolector
# front-end Verilog parser
ENGPKGS += quteRTL
# specific directories
ENGSSRC = eng
MAIN = main
# libraries (if you come up with some readline undefined errors, try replacing -ltinfo with either -ltermcap or -lncurses)
EXTLIBS = -lm -lz -lrt -lreadline -ltermcap -ldl -lgmp -lstdc++
SRCLIBS = $(addprefix -l, $(LIBPKGS)) $(addprefix -l, $(ENGPKGS))
# compile outputs
EXEC = v3
LIB = libv3.a
all: srcLib
@echo "Checking $(MAIN)..."
@cd src/$(MAIN); make --no-print-directory EXTLIB="$(SRCLIBS) $(EXTLIBS)" EXEC=$(EXEC); cd ../.. ;
# @strip $(EXEC)
srcLib: engLib
@for pkg in $(SRCPKGS); \
do \
echo "Checking $$pkg..."; \
cd src/$$pkg; make --no-print-directory PKGNAME=$$pkg; \
cd ../.. ; \
done
engLib:
@for pkg in $(ENGPKGS); \
do \
cd include ; ln -fs ../src/$(ENGSSRC)/$$pkg/* .; cd .. ; \
cd lib ; ln -fs ../src/$(ENGSSRC)/$$pkg/*.a .; cd .. ; \
done
@rm -f include/*.a
clean:
@for pkg in $(SRCPKGS); \
do \
echo "Cleaning $$pkg..."; \
cd src/$$pkg; make --no-print-directory PKGNAME=$$pkg clean; \
cd ../.. ; \
done
@echo "Cleaning $(MAIN)..."
@cd src/$(MAIN); make --no-print-directory clean
@echo "Removing $(EXEC)..."
@rm -f $(EXEC)
ctags:
@rm -f src/tags
@for pkg in $(SRCPKGS); \
do \
echo "Tagging $$pkg..."; \
cd src; ctags -a $$pkg/*.cpp $$pkg/*.h; cd ..; \
done
@echo "Tagging $(MAIN)..."
cd src; ctags -a $(MAIN)/*.cpp
@echo "Tagging $(GUI)..."
cd src; ctags -a $(GUI)/*.cpp
rmdep:
@for pkg in $(SRCPKGS); \
do \
rm src/$$pkg/.*.mak; \
done
@rm src/main/.*.mak;