-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (44 loc) · 1.34 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
INCLUDE_PATH = include
FILES = \
src/data.o\
src/rwlock.o\
src/cog_tester.o\
src/jitd_tester.o\
src/ds_tester.o
HEADERS = $(shell find ${INCLUDE_PATH} -name '*.hpp') \
$(patsubst %.jitd, %.hpp, $(shell find ${INCLUDE_PATH} -name '*.jitd'))
CPP_FLAGS = --std=c++1y
#-g
LINKER_FLAGS = -lpthread
CPP = clang++ -I ${INCLUDE_PATH} -g $(CPP_FLAGS)
all: driver workload_gen
driver : ${FILES} src/driver.cpp
@echo "Building Driver"
@${CPP} ${LINKER_FLAGS} -o $@ $^
workload_gen : src/workload.cpp
@echo "Building Workload Generator"
@${CPP} -o $@ $^
workload/%.jitd : workload_gen
@if [ ! -d workload ] ; then mkdir workload; fi
@echo "Building Workload #" $$(basename $@ .jitd)
@./workload_gen > $@
@du -h $@
workload : $(patsubst %,workload/%.jitd, 1)
%.o : %.cpp
@echo Compiling $(patsubst src/%,%,$*)
@${CPP} -c -o $@ $<
build_test : driver
@for i in test/*.cog; do echo ===== $$i =====; ./driver -c $$i; done
test : build_test
%.hpp : %.jitd ../synthesis/jitd
@echo "Rendering" $(patsubst %.jitd,%,$<)
@../synthesis/jitd $< > $@
clean :
rm -rf *.dSYM
rm -f driver
find src -name '*.o' | xargs rm -f
# ,--- Yes, I know this is a horrible hack.
# V I'm too annoyed with C++ right now to get makedep working.
src/jitd_tester.o : ${HEADERS}
src/cog_tester.o : ${HEADERS}
.PHONY: test clean build_test dep workload jitd