-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
89 lines (65 loc) · 1.79 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
# COMPILER
CC = g++
AR = ar
# TARGET NAMES
TARGET = vasim
LIBVASIM = libvasim.a
# DIRECTORIES
IDIR = ./include
SRCDIR = ./src
MNRL = ./libs/MNRL/C++
PUGI = ./libs/pugixml
# LIBRARY DEPENDENCIES
LIBMNRL = $(MNRL)/libmnrl.a
LIBPUGI = $(PUGI)/build/make-$(CC)-release-standard-c++11/src/pugixml.cpp.o
# FLAGS
CXXFLAGS= -I$(IDIR) -I$(MNRL)/include -I$(PUGI)/src -pthread --std=c++11 -Wno-deprecated
OPTS = -Ofast
ARFLAGS = rcs
CXXFLAGS += $(OPTS)
_DEPS = *.h
_OBJ = errors.o util.o ste.o ANMLParser.o MNRLAdapter.o automata.o element.o specialElement.o gate.o and.o or.o nor.o counter.o inverter.o
MAIN_CPP = main.cpp
ODIR=$(SRCDIR)/obj
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
#
all: submodule_init vasim_release
vasim_release: mnrl pugi
$(info )
$(info Compiling VASim Library...)
$(MAKE) $(TARGET)
mnrl:
$(info )
$(info Compiling MNRL Library...)
$(MAKE) $(LIBMNRL)
pugi:
$(info )
$(info Compiling PugiXML Library...)
$(MAKE) $(LIBPUGI)
$(TARGET): $(SRCDIR)/$(MAIN_CPP) $(LIBVASIM) $(LIBMNRL)
$(info )
$(info Compiling VASim executable...)
$(CC) $(CXXFLAGS) $^ -o $@
$(LIBVASIM): $(LIBPUGI) $(OBJ)
$(AR) $(ARFLAGS) $@ $^
$(ODIR)/%.o: $(SRCDIR)/%.cpp $(DEPS) $(LIBMNRL)
@mkdir -p $(ODIR)
$(CC) $(CXXFLAGS) -c -o $@ $<
$(LIBMNRL):
$(MAKE) CC=$(CC) -C $(MNRL)
$(LIBPUGI):
$(MAKE) CXX=$(CC) -Wno-deprecated config=release -C $(PUGI)
clean: cleanvasim cleanmnrl cleanpugi
cleanvasim:
$(info Cleaning VASim...)
rm -f $(ODIR)/*.o $(TARGET) $(SNAME)
cleanmnrl:
$(info Cleaning MNRL...)
rm -f $(MNRL)/libmnrl.a $(MNRL)/libmnrl.so $(MNRL)/src/obj/*.o
cleanpugi:
$(info Cleaning PugiXML...)
rm -rf $(PUGI)/build
submodule_init:
@git submodule update --init --recursive
.PHONY: clean cleanvasim cleanmnrl cleanpugi vasim_release mnrl pugi submodule_init