Makefile 3.05 KB
Newer Older
bbr's avatar
bbr committed
1
2
3
4
5
6
7
8
BIN = bin/
SRC = src/
LIB = $(SRC)lib/
DIST = dist/
THIS = ../kics/
KGHC = ghc --make -fglasgow-exts -i$(LIBS) -H500m
GHC  = ghc --make -fglasgow-exts -i$(SRC)  -H500m
LIBS = $(shell $(BIN)kicslib)
bbr's avatar
bbr committed
9
KICS = $(BIN)kics -v -make
bbr's avatar
bbr committed
10
ORACLE = $(SRC)oracle/
bbr's avatar
bbr committed
11
12
13
14
15
16

all: $(SRC)InstallDir.hs $(BIN)generate $(BIN)kicslib $(BIN)kics $(BIN)kicsi libs

.PHONY: tools
tools: $(SRC)InstallDir.hs $(BIN)makeExternalInterface 

bbr's avatar
bbr committed
17
$(BIN)generate: $(SRC)InstallDir.hs $(SRC)Generate.hs $(SRC)CurryToHaskell.hs $(SRC)PreTrans.hs
bbr's avatar
bbr committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
	$(GHC) $(SRC)Generate.hs -o $(BIN)generate
	cd $(SRC)
	$(BIN)generate $(SRC)
	cd ..

$(SRC)InstallDir.hs: 
	echo "module InstallDir where"  >  $(SRC)InstallDir.hs
	echo "installDir = \""`pwd`"\"" >> $(SRC)InstallDir.hs

$(BIN)kicslib: $(SRC)InstallDir.hs $(SRC)kicslib.hs $(SRC)Config.hs
	mkdir -p bin 
	ghc -fglasgow-exts -i$(SRC) --make $(SRC)kicslib -o $(BIN)kicslib

$(BIN)makeExternalInterface: $(SRC)InstallDir.hs $(BIN)kicslib
	$(KGHC) $(SRC)MakeExternalInterface -o $(BIN)makeExternalInterface

bbr's avatar
bbr committed
34
$(BIN)kicsi: $(BIN)kicslib $(SRC)CurryToHaskell.hs $(SRC)kicsi.hs $(SRC)PreTrans.hs
bbr's avatar
bbr committed
35
36
37
38
39
40
41
42
43
ifeq (,$(filter readline%,$(shell ghc-pkg list readline)))
	@echo no readline package found
	cp $(SRC)NoReadline.make $(SRC)MyReadline.hs
else
	@echo readline package found
	cp $(SRC)WithReadline.make $(SRC)MyReadline.hs
endif
	$(KGHC) $(SRC)kicsi -o $(BIN)kicsi

bbr's avatar
bbr committed
44
$(BIN)kics:  $(BIN)kicslib $(SRC)CurryToHaskell.hs $(SRC)PreTrans.hs $(SRC)kics.hs
bbr's avatar
bbr committed
45
46
47
48
49
50
51
52
	$(KGHC) $(SRC)kics -o $(BIN)kics

.PHONY: runtime
runtime: $(SRC)InstallDir.hs  
	$(KGHC) --make $(SRC)Curry.hs

.PHONY: libs 
libs: $(BIN)kics runtime
bbr's avatar
bbr committed
53
	$(KICS) $(LIB)All_Libraries
bbr's avatar
bbr committed
54
55
56

.PHONY: clean
clean:
57
	rm -f *.o *.hi $(LIB)*.o $(LIB)*.hi  $(ORACLE)*.o $(ORACLE)*.hi $(SRC)*.o $(SRC)*.hi test/*.o test/*.hi
bbr's avatar
bbr committed
58
59
60
61
62
63

.PHONY: mrproper
mrproper: clean
	rm -f $(SRC)InstallDir.hs
	rm -f $(SRC)AutoGenerated*.hs
	rm -f $(LIB)Curry*.hs $(LIB)Data*.hs $(LIB)Instances*.hs $(LIB)*.fcy $(LIB)*.fint\
64
              $(ORACLE)Curry*.hs $(ORACLE)Data*.hs $(ORACLE)Instances*.hs $(ORACLE)*.fcy $(ORACLE)*.fint\
bbr's avatar
bbr committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
              test/Curry*.hs  test/Data*.hs  test/Instances*.hs  test/*.fcy  test/*.fint


.PHONY: dist
dist: 
	mkdir -p dist
	rm -f $(SRC)InstallDir.hs
	tar czf $(THIS)$(DIST)kics_src.tgz\
	  $(THIS)$(LIB)*.curry \
	  $(THIS)$(LIB)/ExternalData*.hs \
	  $(THIS)$(LIB)/ExternalInstances*.hs \
	  $(THIS)$(LIB)/ExternalFunctions*.hs \
	  $(THIS)$(LIB)/External*.spec \
	  $(THIS)$(SRC)*.hs\
	  $(THIS)$(SRC)*.make\
	  $(THIS)Makefile $(THIS)INSTALL\
	  $(THIS)$(BIN)kghc
	cp $(THIS)$(DIST)kics_src.tgz ~/public_html/download/
	chmod a+r ~/public_html/download/kics_src.tgz

bbr's avatar
bbr committed
85
bio: $(BIN)stricths $(BIN)prophecy $(BIN)biotope
bbr's avatar
bbr committed
86

bbr's avatar
bbr committed
87
$(BIN)stricths: $(ORACLE)stricths.curry $(ORACLE)PrettyStrict.curry
bbr's avatar
bbr committed
88
89
90
91
	$(KICS) -executable -o $(BIN)stricths -userlibpath $(ORACLE) stricths.curry 

$(BIN)prophecy: $(ORACLE)Transform.curry
	$(KICS) -executable -o $(BIN)prophecy -userlibpath $(ORACLE) Transform.curry 
bbr's avatar
bbr committed
92

bbr's avatar
bbr committed
93
94
95
96
$(BIN)biotope: $(ORACLE)Biotope.curry
	$(KICS) -executable -o $(BIN)biotope -userlibpath $(ORACLE) Biotope.curry 


bbr's avatar
bbr committed
97
98
$(BIN)prettyflat: 
	$(KICS) -executable -o $(BIN)prettyflat -main mainPrint PrettyFlat.curry