]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - examples/Makefile
Unfoldable Dispatcher
[Lucu.git] / examples / Makefile
index 5200e84479c35e7a8296d3fb84454a0c01e61991..606117f31f43ffcd6489b0d3370668265979d997 100644 (file)
@@ -1,19 +1,35 @@
-build: MiseRafturai.hs SmallFile.hs
-       ghc --make HelloWorld -threaded -O3 -fwarn-unused-imports
-       ghc --make Implanted -threaded -O3 -fwarn-unused-imports
-       ghc --make ImplantedSmall -threaded -O3 -fwarn-unused-imports
-       ghc --make Multipart -threaded -O3 -fwarn-unused-imports
+TARGETS = \
+       HelloWorld \
+       Implanted \
+       ImplantedSmall \
+       Multipart \
+       SSL \
+       $(NULL)
+
+IMPLANT ?= ../dist/build/lucu-implant-file/lucu-implant-file
+
+build: $(TARGETS)
+
+SSL: SSL.hs
+       -ghc -Wall --make $@ -threaded -O3 -idist -odir dist -hidir dist
+
+%: %.hs
+       ghc -Wall --make $@ -threaded -O3 -idist -odir dist -hidir dist
 
 run: build
        ./HelloWorld
 
 clean:
-       rm -f HelloWorld Implanted MiseRafturai.hs ImplantedSmall SmallFile.hs Multipart *.hi *.o
+       rm -rf $(TARGETS) dist
 
-MiseRafturai.hs: mise-rafturai.html
-       lucu-implant-file -m MiseRafturai -o $@ $<
+Implanted.hs: dist/MiseRafturai.hs
+dist/MiseRafturai.hs: mise-rafturai.html $(IMPLANT)
+       mkdir -p dist
+       $(IMPLANT) -m MiseRafturai -o $@ $<
 
-SmallFile.hs: small-file.txt
-       lucu-implant-file -m SmallFile -o $@ $<
+ImplantedSmall.hs: dist/SmallFile.hs
+dist/SmallFile.hs: small-file.txt $(IMPLANT)
+       mkdir -p dist
+       $(IMPLANT) -m SmallFile -t "text/plain; charset=\"UTF-8\"" -o $@ $<
 
 .PHONY: build run clean