forked from eldesh/aobench_sml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile-smlsharp-1.2.0
49 lines (39 loc) · 971 Bytes
/
makefile-smlsharp-1.2.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
SMLSHARP = smlsharp-1.2.0
ifeq ($(OS),Windows_NT)
TARGETS = aobench-smlsharp-1.2.0.exe
else
TARGETS = aobench-smlsharp-1.2.0
endif
VPATH = .:smlnjlib
SMLSHARPFLAGS = -I smlnjlib
## 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) -o $@ $<
## .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 -f $(TARGETS)
rm -f $(filter %.d,$(SRCS:.sml=.d))
rm -f $(addprefix smlnjlib/,$(OBJS))
rm -f aobench.o