Makefile 3.25 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 5 -make
bbr's avatar
bbr committed
10
ORACLE = $(SRC)oracle/
bbr's avatar
bbr committed
11
CPNS = cpns/
bbr's avatar
bbr committed
12
WWW = www/
bbr's avatar
bbr committed
13

bbr's avatar
bbr committed
14
all: $(SRC)InstallDir.hs $(BIN)generate $(BIN)kicslib $(BIN)kics $(BIN)kicsi libs cpns www
bbr's avatar
bbr committed
15
16

.PHONY: tools
17
tools: $(SRC)InstallDir.hs $(BIN)makeExternalInterface $(BIN)prettyflat
bbr's avatar
bbr committed
18

bbr's avatar
bbr committed
19
$(BIN)generate: $(SRC)InstallDir.hs $(SRC)Generate.hs $(SRC)CurryToHaskell.hs $(SRC)PreTrans.hs
bbr's avatar
bbr committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
	$(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
36
$(BIN)kicsi: $(BIN)kicslib $(SRC)CurryToHaskell.hs $(SRC)kicsi.hs $(SRC)PreTrans.hs
bbr's avatar
bbr committed
37
38
39
40
41
42
43
44
45
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
46
$(BIN)kics:  $(BIN)kicslib $(SRC)CurryToHaskell.hs $(SRC)PreTrans.hs $(SRC)kics.hs
bbr's avatar
bbr committed
47
48
49
50
51
52
53
54
	$(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
55
	$(KICS) $(LIB)All_Libraries
bbr's avatar
bbr committed
56
57
58

.PHONY: clean
clean:
59
	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
60
61
62
63
64
65

.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\
66
              $(ORACLE)Curry*.hs $(ORACLE)Data*.hs $(ORACLE)Instances*.hs $(ORACLE)*.fcy $(ORACLE)*.fint\
bbr's avatar
bbr committed
67
68
69
70
71
72
              test/Curry*.hs  test/Data*.hs  test/Instances*.hs  test/*.fcy  test/*.fint


.PHONY: dist
dist: 
	mkdir -p dist
bbr's avatar
bbr committed
73
	git archive -v --prefix=kics/ master | gzip > $(THIS)$(DIST)kics_src.tgz  
bbr's avatar
bbr committed
74
75
76
	cp $(THIS)$(DIST)kics_src.tgz ~/public_html/download/
	chmod a+r ~/public_html/download/kics_src.tgz

bbr's avatar
bbr committed
77
bio: $(BIN)stricths $(BIN)prophecy $(BIN)biotope  biostdlibraries
bbr's avatar
bbr committed
78

bbr's avatar
bbr committed
79
$(BIN)stricths: $(ORACLE)stricths.curry $(ORACLE)PrettyStrict.curry
bbr's avatar
bbr committed
80
81
82
83
	$(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
84

bbr's avatar
bbr committed
85
86
87
$(BIN)biotope: $(ORACLE)Biotope.curry
	$(KICS) -executable -o $(BIN)biotope -userlibpath $(ORACLE) Biotope.curry 

88
89
90
bioprelude:
	cd $(LIB);stricths Prelude;prophecy Prelude;cd ../..

bbr's avatar
bbr committed
91
biostdlibraries: bioprelude
92
	cd $(LIB);stricths -m All_Libraries;prophecy -m All_Libraries;cd ../..
bbr's avatar
bbr committed
93

bbr's avatar
bbr committed
94

bbr's avatar
bbr committed
95
$(BIN)prettyflat: 
96
	$(KICS) -userlibpath ~/lehrstuhl/curry/libraries -executable -o $(BIN)prettyflat -main mainPrint PrettyFlat.curry 
bbr's avatar
bbr committed
97
98
99
100

cpns: $(CPNS)CPNS.state

$(CPNS)CPNS.state: $(LIB)CPNS.curry
bbr's avatar
bbr committed
101
102
103
104
105
106
	$(KICS) -executable -o $(CPNS)CPNS.state $(LIB)CPNS.curry

www: ($WWW)submitform

($WWW)submitform: $(LIB)HtmlCgi.curry
	make -C $(WWW)