-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
60 lines (42 loc) · 1.12 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
# configurations
ifndef CORESTAR_HOME
CORESTAR_HOME=$(CURDIR)/../corestar
endif
export CORESTAR_HOME
ifndef JSTAR_HOME
JSTAR_HOME=$(CURDIR)
endif
export JSTAR_HOME
SRC_DIRS=src corestar_src
MAINS=jstar
LIBS=dynlink str unix
# section with stuff that shouldn't change often
SHELL=/bin/bash
SRC_SUBDIRS=$(addsuffix .subdirs,$(SRC_DIRS))
OCAMLBUILD=ocamlbuild `cat $(SRC_SUBDIRS)` $(addprefix -lib ,$(LIBS))
build: native
native byte: $(SRC_SUBDIRS)
$(OCAMLBUILD) $(addsuffix .$@,$(MAINS))
for f in $(MAINS); do ln -sf ../`readlink $$f.$@` bin/$$f; rm $$f.$@; done
test: test-native
test-native test-byte: test-%: %
$(MAKE) -s -C unit_tests
doc:
$(MAKE) -C doc/tutorial # DEV
scripts:
$(MAKE) -C scripts # DEV
all: build test
clean:
ocamlbuild -clean
rm -f lib/*.a lib/*.cmxa lib/*.cmxs bin/* *.subdirs
rm -rf corestar_src # DEV
$(MAKE) -C unit_tests clean
$(MAKE) -C scripts clean # DEV
$(MAKE) -C doc/tutorial clean # DEV
%.subdirs: %
ls -F $*/ | grep / | sed "s./.." | sed "s.^.-I $*/." > $*.subdirs
corestar_src:
ln -sf "$(CORESTAR_HOME)/src" corestar_src
.PHONY: build clean doc test
-include .install.mk
#vim:noet: