Makefile 812 Bytes
Newer Older
Anders Blomdell's avatar
Anders Blomdell committed
1
SUBDIRS=compiler lib test examples packaging
Anders Blomdell's avatar
Anders Blomdell committed
2
export LABCOMM_JAR=$(shell pwd)/compiler/labcomm2014_compiler.jar
3
4
export LABCOMM=java -jar $(LABCOMM_JAR) 

5
6
UNAME_S=$(shell uname -s)

Anders Blomdell's avatar
Anders Blomdell committed
7
.PHONY: all
Anders Blomdell's avatar
Anders Blomdell committed
8
all: $(SUBDIRS:%=all-%)
9

Anders Blomdell's avatar
Anders Blomdell committed
10
11
.PHONY: all-%
all-%:
12
13
14
ifeq ($(UNAME_S),Darwin)
	DYLD_LIBRARY_PATH=`pwd`/lib/c $(MAKE) -C $*
else
Anders Blomdell's avatar
Anders Blomdell committed
15
	LD_LIBRARY_PATH=`pwd`/lib/c $(MAKE) -C $*
16
endif
17
18

.PHONY: test
Anders Blomdell's avatar
Anders Blomdell committed
19
20
21
22
test: $(SUBDIRS:%=test-%)

.PHONY: test-%
test-%:
23
24
25
ifeq ($(UNAME_S),Darwin)
	DYLD_LIBRARY_PATH=`pwd`/lib/c $(MAKE) -C $* test
else
Anders Blomdell's avatar
Anders Blomdell committed
26
	LD_LIBRARY_PATH=`pwd`/lib/c $(MAKE) -C $* test
27
endif
Anders Blomdell's avatar
Anders Blomdell committed
28
29
30
31
32
33

.PHONY: clean
clean: $(SUBDIRS:%=clean-%)

.PHONY: clean-%
clean-%:
Anders Blomdell's avatar
Anders Blomdell committed
34
	$(MAKE) -C $* clean
Anders Blomdell's avatar
Anders Blomdell committed
35
36

.PHONY: distclean
37
distclean: clean $(SUBDIRS:%=distclean-%)
Anders Blomdell's avatar
Anders Blomdell committed
38
39
40

.PHONY: distclean-%
distclean-%:
Anders Blomdell's avatar
Anders Blomdell committed
41
	$(MAKE) -C $* distclean
Anders Blomdell's avatar
Anders Blomdell committed
42
43
44
45

.PHONY: srpm
srpm:
	make -C packaging $@