]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - data/Makefile
Make use of mimeType quasi-quoter.
[Lucu.git] / data / Makefile
index 23c69ed5ced6af25687db13e03462d77819077af..c73c1f3c2e5416eea76156db425503848ad718d8 100644 (file)
@@ -1,10 +1,18 @@
-../Network/HTTP/Lucu/MIMEType/DefaultExtensionMap.hs: mime.types CompileMimeTypes
-       ./CompileMimeTypes $< $@
+../Network/HTTP/Lucu/MIMEType/DefaultExtensionMap.hs: dist/DefaultExtensionMap.hs
+       cp -f $< $@
 
-CompileMimeTypes:
-       ghc --make $@ -i..
+dist/DefaultExtensionMap.hs: mime.types compiler
+       ./CompileMimeTypes $< $@.tmp
+       if diff $@ $@.tmp >/dev/null; then \
+               rm -f $@.tmp; \
+       else \
+               mv -f $@.tmp $@; \
+       fi
+
+compiler:
+       ghc -Wall --make CompileMimeTypes -i.. -odir dist -hidir dist
 
 clean:
-       rm -f *.hi *.o CompileMimeTypes
+       rm -rf dist DefaultExtensionMap.hs CompileMimeTypes
 
-.PHONY: clean
+.PHONY: clean compiler