forked from eldesh/aobench_sml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile-smlsharp-2.0.0
53 lines (43 loc) · 1.09 KB
/
makefile-smlsharp-2.0.0
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
SMLSHARP = smlsharp-2.0.0
ifeq ($(OS),Windows_NT)
TARGETS = aobench-smlsharp-2.0.0.exe
else
TARGETS = aobench-smlsharp-2.0.0
endif
VPATH = .:smlnjlib
SMLSHARPFLAGS = -I smlnjlib
SMLSHARPEXTRAFLAGS = -dskipPrinter=yes
SMLSHARPLLVMFLAGS = -emit-llvm -O3
## source code
SRCS = random.sml \
packword32big.sml \
realarray.sml \
lib-base.sml \
aobench.sml \
aobench_driver.sml
OBJS = $(filter %.o,$(SRCS:.sml=.o))
## default targets
all: $(TARGETS)
##
$(TARGETS): %: aobench_driver.sml $(OBJS)
$(SMLSHARP) \
$(SMLSHARPFLAGS) $(SMLSHARPEXTRAFLAGS) $(SMLSHARPLLVMFLAGS) \
-o $@ $<
## .o type rules
%.o: %.sml
$(SMLSHARP) $(SMLSHARPFLAGS) $(SMLSHARPEXTRAFLAGS) -c $<
## generate for SML dependence
%.d: %.sml
@echo "generate [$@] from [$*]"
@$(SHELL) -ec '$(SMLSHARP) -MM $(SMLSHARPFLAGS) $< \
| sed "s/\($*\)\.o[ :]*/\1.o $@ : /g" > $@; \
[ -s $@ ] || rm -rf $@'
ifeq (,$(findstring $(MAKECMDGOALS),clean))
include $(filter %.d,$(SRCS:.sml=.d))
endif
.PHONY: clean
clean:
rm -f $(TARGETS)
rm -f $(filter %.d,$(SRCS:.sml=.d))
rm -f $(addprefix smlnjlib/,$(OBJS))
rm -f aobench.o