-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·50 lines (38 loc) · 930 Bytes
/
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
CC = g++
CFLAGS = -Isrc -O3 -Wall -std=c++11
rm = @rm
mkdir = @mkdir
exe = mapper
OBJs = objs/QASMparser.o \
objs/QASMscanner.o \
objs/QASMtoken.o
HPPs = src/GateNode.hpp \
src/QASMparser.h \
src/util.cpp
ifeq ($(OS),Windows_NT)
rm = @del /F /Q
CFLAGS += -D WINDOWS
exe = mapper.exe
else
mkdir += -p
rm += -f -r
endif
default: objs ${exe}
debug: CFLAGS += -g -O0 -fsanitize=address
debug: default
prof: CFLAGS += -pg -fno-inline
prof: default
mapper: src/main.cpp ${OBJs} ${HPPs}
${CC} ${CFLAGS} ${OBJs} $< -o $@
mapper.exe: src/main.cpp ${OBJs} ${HPPs}
${CC} ${CFLAGS} ${OBJs} $< -o $@
objs:
${mkdir} objs
objs/QASMparser.o: src/QASMparser.cpp src/QASMparser.h
${CC} ${CFLAGS} -c $< -o $@
objs/QASMscanner.o: src/QASMscanner.cpp src/QASMscanner.hpp
${CC} ${CFLAGS} -c $< -o $@
objs/QASMtoken.o: src/QASMtoken.cpp src/QASMtoken.hpp
${CC} ${CFLAGS} -c $< -o $@
clean:
${rm} mapper mapper.exe objs