Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 106 lines (82 sloc) 3.574 kb
d4b1e50 @nominolo Use JSON as the external format.
nominolo authored
1 .PHONY: default clean install-lib install-deps setup
3b12f40 @nominolo Fix build.
nominolo authored
2
3 default: all
e3dc7b0 @nominolo Add "run" Makefile target. Useful when hacking on Scion.
nominolo authored
4 all: build
5
9e660d9 @nominolo Put user-specific Makefile settings into config.mk.
nominolo authored
6 include config.mk
6334314 @nominolo Clean up Makefile a bit. Setup[.exe] is now put into setup-dist/ direct...
nominolo authored
7
3b12f40 @nominolo Fix build.
nominolo authored
8 # If not set in custom config.mk, use the default versions
9 HC ?= ghc
10 PKG ?= ghc-pkg
11 HADDOCK ?= haddock
6334314 @nominolo Clean up Makefile a bit. Setup[.exe] is now put into setup-dist/ direct...
nominolo authored
12
3b12f40 @nominolo Fix build.
nominolo authored
13 DIST = dist
14 DIST_LIB = $(DIST)/lib
15 DIST_SERVER = $(DIST)/server
6334314 @nominolo Clean up Makefile a bit. Setup[.exe] is now put into setup-dist/ direct...
nominolo authored
16 SETUP_DIST = setup-dist
17 SETUP = $(SETUP_DIST)/Setup
ab2d7e2 @nominolo Initial commit.
nominolo authored
18
0f346e6 @nominolo Add 'cabal-install' make target and some more Makefile fixes.
nominolo authored
19 CABAL_INSTALL_OPTS += --ghc --with-compiler=$(HC) --with-hc-pkg=$(PKG)
3b12f40 @nominolo Fix build.
nominolo authored
20 CABAL_FLAGS ?=
21 # -ftesting
22
89c8f93 @nominolo Create dist directory if missing. Fixes build from freshly checked out ...
nominolo authored
23 $(DIST):
24 mkdir $(DIST)
25
26 $(DIST_LIB)/setup-config: $(SETUP) lib/scion.cabal $(DIST)
3b12f40 @nominolo Fix build.
nominolo authored
27 @echo === Configuring scion ===
28 @echo Configure log: $(DIST)/lib-config-log
29 @cd lib && \
30 (../$(SETUP) configure -v --builddir=../$(DIST_LIB) \
31 --with-compiler=$(HC) --with-hc-pkg=$(PKG) \
32 --user $(CABAL_FLAGS)> ../$(DIST)/lib-config-log)
33
89c8f93 @nominolo Create dist directory if missing. Fixes build from freshly checked out ...
nominolo authored
34 $(DIST_SERVER)/setup-config: $(SETUP) server/scion-server.cabal $(DIST) $(DIST_LIB)/.installed_tag
3b12f40 @nominolo Fix build.
nominolo authored
35 @echo === Configuring scion-server ===
36 @echo Configure log: $(DIST)/server-config-log
37 @cd server && \
38 (../$(SETUP) configure -v --builddir=../$(DIST_SERVER) \
39 --with-compiler=$(HC) --with-hc-pkg=$(PKG) \
40 --user $(CABAL_FLAGS) > ../$(DIST)/server-config-log)
41
6e46357 @nominolo Add more precise dependencies in Makefile.
nominolo authored
42 $(DIST_LIB)/build/libHSscion-0.1.a: $(SETUP) $(DIST_LIB)/setup-config lib/**/*.hs lib/**/**/*.hs
3b12f40 @nominolo Fix build.
nominolo authored
43 @echo === Building scion ===
44 @cd lib && \
45 ../$(SETUP) build --builddir=../$(DIST_LIB)
46
47 $(DIST_LIB)/.installed_tag: $(DIST_LIB)/build/libHSscion-0.1.a $(SETUP)
48 @echo === Installing scion ===
49 @cd lib && ../$(SETUP) install --user --builddir=../$(DIST_LIB)
50 @touch $@
51
116dc71 @nominolo Use lazy Bytestrings in ConnectionIO so we have efficient append.
nominolo authored
52 $(DIST_SERVER)/build/scion_server/scion_server: $(SETUP) $(DIST_SERVER)/setup-config server/Main.hs server/Scion/Server/*.hs server/Scion/Server/**/*.hs
3b12f40 @nominolo Fix build.
nominolo authored
53 @echo === Building scion-server ===
54 @cd server && \
55 ../$(SETUP) build --builddir=../$(DIST_SERVER)
ab2d7e2 @nominolo Initial commit.
nominolo authored
56
5516df4 @nominolo Generalise Makefile rules a bit.
nominolo authored
57 $(SETUP): Setup.hs
3b12f40 @nominolo Fix build.
nominolo authored
58 @echo === Building Setup ===
6334314 @nominolo Clean up Makefile a bit. Setup[.exe] is now put into setup-dist/ direct...
nominolo authored
59 @mkdir -p $(SETUP_DIST)
3b12f40 @nominolo Fix build.
nominolo authored
60 @$(HC) --make -odir $(SETUP_DIST) -hidir $(SETUP_DIST) -o $@ $<
ab2d7e2 @nominolo Initial commit.
nominolo authored
61
d4b1e50 @nominolo Use JSON as the external format.
nominolo authored
62 setup: $(SETUP)
63
3b12f40 @nominolo Fix build.
nominolo authored
64 build: $(DIST_LIB)/build/libHSscion-0.1.a $(DIST_SERVER)/build/scion_server/scion_server
ab2d7e2 @nominolo Initial commit.
nominolo authored
65
3b12f40 @nominolo Fix build.
nominolo authored
66 # test: build
67 # echo main | $(HC) --interactive -package ghc -DDEBUG -isrc -idist/build tests/RunTests.hs
68 # # ./dist/build/test_get_imports/test_get_imports $(GHC_PATH)/compiler dist-stage2 +RTS -s -RTS
ab2d7e2 @nominolo Initial commit.
nominolo authored
69
70 clean:
3b12f40 @nominolo Fix build.
nominolo authored
71 @(cd lib && ../$(SETUP) clean --builddir=../$(DIST_LIB)) || rm -rf $(DIST_LIB)
72 @(cd server && ../$(SETUP) clean --builddir=../$(DIST_SERVER)) || rm -rf $(DIST_SERVER)
e5c71e5 @nominolo Add script+make target for running the test suite.
nominolo authored
73
3b12f40 @nominolo Fix build.
nominolo authored
74 # distclean: clean
75 # rm -rf $(SETUP_DIST)
6334314 @nominolo Clean up Makefile a bit. Setup[.exe] is now put into setup-dist/ direct...
nominolo authored
76
3b12f40 @nominolo Fix build.
nominolo authored
77 # doc: configure
78 # $(SETUP) haddock --with-haddock=$(HADDOCK)
6334314 @nominolo Clean up Makefile a bit. Setup[.exe] is now put into setup-dist/ direct...
nominolo authored
79
80 printvars:
0f346e6 @nominolo Add 'cabal-install' make target and some more Makefile fixes.
nominolo authored
81 @echo "UseInplaceGhc = $(UseInplaceGhc)"
82 @echo "GHC_PATH = $(GHC_PATH)"
83 @echo "HC = $(HC)"
84 @echo "PKG = $(PKG)"
85 @echo "HADDOCK = $(HADDOCK)"
86 @echo "CABAL_INSTALL = $(CABAL_INSTALL)"
87 @echo " ..._OPTS = $(CABAL_INSTALL_OPTS)"
5c184de @nominolo Abstract Cabal flags into a Makefile variable.
nominolo authored
88 @echo "CABAL_FLAGS = $(CABAL_FLAGS)"
0f346e6 @nominolo Add 'cabal-install' make target and some more Makefile fixes.
nominolo authored
89 @echo "---------------------------------------------------------------"
3b12f40 @nominolo Fix build.
nominolo authored
90 @echo "DIST_LIB = $(DIST_LIB)"
0f346e6 @nominolo Add 'cabal-install' make target and some more Makefile fixes.
nominolo authored
91 @echo "SETUP_DIST = $(SETUP_DIST)"
92
3b12f40 @nominolo Fix build.
nominolo authored
93 install-deps:
94 cabal install --with-compiler=$(HC) --with-hc-pkg=$(PKG) ghc-paths
95 cabal install --with-compiler=$(HC) --with-hc-pkg=$(PKG) ghc-syb
96 cabal install --with-compiler=$(HC) --with-hc-pkg=$(PKG) multiset
97 cabal install --with-compiler=$(HC) --with-hc-pkg=$(PKG) time
98 cabal install --with-compiler=$(HC) --with-hc-pkg=$(PKG) uniplate
99
100
101 # cabal-install:
102 # $(CABAL_INSTALL) install $(CABAL_INSTALL_OPTS) $(CABAL_FLAGS)
e3dc7b0 @nominolo Add "run" Makefile target. Useful when hacking on Scion.
nominolo authored
103
3b12f40 @nominolo Fix build.
nominolo authored
104 # run-emacs: build
105 # ./$(DIST)/build/scion_emacs/scion_emacs
Something went wrong with that request. Please try again.