Makefile 1.19 KB
Newer Older
Camil Staps's avatar
Camil Staps committed
1
SHELL:=bash
Camil Staps's avatar
Camil Staps committed
2
BIN:=builddb CloogleServer
3
DB=types.json
Camil Staps's avatar
Camil Staps committed
4
CLM:=clm
Camil Staps's avatar
Camil Staps committed
5
CLMFLAGS_BOOTSTRAP:=-h 250M -nr -nortsopts\
6 7
	-P 'Cloogle'\
	-IL StdEnv\
8 9 10
	-IL TCPIP\
	-IL Platform\
	-IL Platform/Deprecated/ArgEnv\
11
	-I Cloogle\
Camil Staps's avatar
Camil Staps committed
12
	-I Cloogle/libcloogle\
Camil Staps's avatar
Camil Staps committed
13
	-I Cloogle/CleanRegex
14
ifeq "$(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 6)" "1"
Camil Staps's avatar
Camil Staps committed
15
	CLMFLAGS_BOOTSTRAP+=-l -no-pie
16
endif
Camil Staps's avatar
Camil Staps committed
17 18 19 20 21 22
CLMFLAGS:=$(CLMFLAGS_BOOTSTRAP) -funcmayfail
CLMLIBS_COMPILER:=\
	-I Cloogle/compiler/frontend\
	-I Cloogle/compiler/backend\
	-I Cloogle/compiler/main\
	-I Cloogle/compiler/main/Unix\
23

Camil Staps's avatar
Camil Staps committed
24
.PHONY: all bootstrap bootstrap_compiler clean .FORCE
25

26
all: $(BIN) $(DB)
27

28 29
man: $(MAN)

Camil Staps's avatar
Camil Staps committed
30
CloogleServer: bootstrap .FORCE
31
	$(CLM) $(CLMFLAGS) $@ -o $@
32

Camil Staps's avatar
Camil Staps committed
33 34 35 36 37 38 39 40 41 42
builddb: bootstrap bootstrap_compiler .FORCE
	$(CLM) $(CLMFLAGS) $(CLMLIBS_COMPILER) -s 50M -h 750M -gcm $@ -o $@

bootstrap: .FORCE
	$(CLM) $(CLMFLAGS_BOOTSTRAP) -PABC StdEnv
	$(CLM) $(CLMFLAGS_BOOTSTRAP) -PABC StdMaybe
	$(CLM) $(CLMFLAGS_BOOTSTRAP) -PABC TCPIP

bootstrap_compiler: Cloogle/compiler .FORCE
	$(CLM) $(CLMFLAGS_BOOTSTRAP) $(CLMLIBS_COMPILER) -PABC cocl
Camil Staps's avatar
Camil Staps committed
43

44 45
Cloogle/compiler: .FORCE
	$(MAKE) -C Cloogle compiler
46

47
$(DB): builddb
Camil Staps's avatar
Camil Staps committed
48
	./$< > $(DB)
49 50

clean:
51 52
	find -name '*.abc' -delete
	$(RM) $(BIN) $(MAN) $(DB)
53

Camil Staps's avatar
Camil Staps committed
54
.FORCE: