Makefile 2.67 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
10
KICS = $(BIN)kics -make
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

.PHONY: clean
clean:
	rm -f *.o *.hi $(LIB)*.o $(LIB)*.hi $(SRC)*.o $(SRC)*.hi test/*.o test/*.hi

.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\
              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
84
85
oracle: $(BIN)stricths $(BIN)prophecy

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

$(BIN)prophecy: $(ORACLE)Transform.curry
	$(KICS) -executable -o $(BIN)prophecy -userlibpath $(ORACLE) Transform.curry