-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile-smlsharp
55 lines (43 loc) · 1.08 KB
/
makefile-smlsharp
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
SMLSHARP = smlsharp
ifeq ($(OS),Windows_NT)
TARGETS = aobench-smlsharp.exe
else
TARGETS = aobench-smlsharp aobench-smlsharp-par
endif
VPATH = .:smlnjlib
SMLSHARPFLAGS = -I smlnjlib -O3
## source code
SRCS := \
random.sml \
packword32big.sml \
realarray.sml \
lib-base.sml \
forkjoin.sml \
aobench_driver.sml \
aobench_driver-par.sml \
aobench.sml \
aobench-mpl.sml
OBJS = $(filter %.o,$(SRCS:.sml=.o))
## default targets
all: $(TARGETS)
##
$(TARGETS): %: $(OBJS)
$(SMLSHARP) $(SMLSHARPFLAGS) -o $@ $(subst -smlsharp,_driver,$@).smi
## .o type rules
%.o: %.sml
$(SMLSHARP) $(SMLSHARPFLAGS) -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) $(TARGETS)
$(RM) $(filter %.d,$(SRCS:.sml=.d))
$(RM) $(addprefix smlnjlib/,$(OBJS))
$(RM) $(OBJS)