forked from The-OpenROAD-Project/RePlAce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
103 lines (85 loc) · 3.09 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
94
95
96
97
98
99
100
101
102
103
CC = gcc
CPPC = g++
LD = ld
OPTFLAG = -m64 -O3 -fPIC -DNDEBUG -ffast-math -Dcimg_display=1
WFLAG = -W -Wall -Wextra -Wunreachable-code
WSTRICT = -Werror -Wundef -Wpointer-arith
INCLUDE = -I$(CURDIR) -I$(MKLROOT)/include -I$(IPPROOT)/include \
-I$(HASHROOT) -I$(EIGENROOT) -I$(CIMGROOT) \
-I$(LEFROOT)/include -I$(DEFROOT)/include -I$(VERILOGROOT)/include
IMATH = -I$(MKLROOT)/include -I$(IPPROOT)/include
CFLAG = -std=c11 $(OPTFLAG)
CPPFLAG = -std=c++14 $(OPTFLAG)
#Get Only the Internal Structure of SRCDIR Recursively
SRCDIR = $(CURDIR)
STRUCT = $(shell find $(SRCDIR) -type d)
#Get All Files inside the STRUCTURE Variable
ALLSRCs = $(addsuffix /*,$(STRUCT))
ALLSRCs := $(wildcard $(ALLSRCs))
#Filter Only Specific Files
CFILES = $(filter %.c,$(ALLSRCs))
CPPFILES = $(filter %.cpp,$(ALLSRCs))
HFILES = $(filter %.h,$(ALLSRCs))
COBJ = $(subst $(SRCDIR),$(CURDIR),$(CFILES:%.c=%.o))
CPPOBJ = $(subst $(SRCDIR),$(CURDIR),$(CPPFILES:%.cpp=%.o))
OBJFILES = $(COBJ) $(CPPOBJ)
DEPENDS = $(HFILES)
LEFROOT = ../module/lef/5.8-p027
DEFROOT = ../module/def/5.8-p027
VERILOGROOT = ../module/verilog-parser
DEFLIB = -L$(DEFROOT)/lib -ldef -ldefzlib -lcdef -lcdefzlib
LEFLIB = -L$(LEFROOT)/lib -llef -llefzlib -lclef -lclefzlib
VERILOGLIB = -L$(VERILOGROOT)/lib -lverilog_parser
ifndef MKLROOT
MKLROOT = /home/tool/intel/MKL/2018_0_128/compilers_and_libraries_2018.0.128/linux/mkl
endif
ifndef IPPROOT
IPPROOT = /home/tool/intel/MKL/2018_0_128/compilers_and_libraries_2018.0.128/linux/ipp
endif
HASHROOT = ../module/sparsehash/install-sp/include
EIGENROOT = ../module/eigen-git-mirror/
CIMGROOT = ../module/CImg/
### RULES ###############
%.o: %.c $(DEPENDS)
@echo " "
@echo " Building... $@"
$(CPPC) $(CPPFLAG) $(IFLUTE) -c -o $@ $<
%.o: %.cpp $(DEPENDS)
@touch main.cpp
@echo " "
@echo " Building... $@"
$(CPPC) $(CPPFLAG) $(INCLUDE) -c -o $@ $<
RePlAce : $(OBJFILES)
@echo " "
@echo " Linking..."
@echo " Intel Math Kernel Library (MKL 11.3.3) and"
@echo " Intel Integrated Performance Primitives (IPP 9.0.3) have been included"
@echo " with static libs..."
@echo " If you want to replace them into shared libs, do '-L PATH -lippi,' etc."
@echo " "
$(CPPC) -o $@ \
$(CPPFLAG) \
$^ \
-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a \
${MKLROOT}/lib/intel64/libmkl_gnu_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a \
${IPPROOT}/lib/intel64/libippi.a ${IPPROOT}/lib/intel64/libipps.a \
${IPPROOT}/lib/intel64/libippcore.a ${IPPROOT}/lib/intel64/libippvm.a \
-Wl,--end-group -lgomp -lpthread -lm -ldl -lX11 ${LEFLIB} ${DEFLIB} ${VERILOGLIB} -static-libstdc++
@echo " "
@echo " Linking is completed !!"
@echo " "
@echo " Tagging..."
ctags -R *
@echo " "
@echo "- Compiling RePlAce is done."
@echo " "
@echo "GNU GCC/G++ compiler has been used."
@gcc --version
@echo " "
clean :
@echo "Delete: OBJs"
@rm -rvf $(OBJFILES)
@echo "Delete: binary"
@rm -rvf $(CURDIR)/RePlAce
tag :
ctags -R *