shaniqua-plugins/Makefile

81 lines
2.1 KiB
Makefile
Raw Normal View History

2005-04-24 08:51:33 +00:00
# Copyright (c) 2004 Don Stewart - http://www.cse.unsw.edu.au/~dons
# LGPL version 2.1 or later (see http://www.gnu.org/copyleft/lesser.html)
# cut down reimplementation of $fptools/mk directory
.PHONY: build all
all: build EvalHaskell.h
2005-04-24 08:51:33 +00:00
build::
2005-08-18 05:05:19 +00:00
cd src ;\
$(GHC) -o setup --make Setup.hs ;\
2005-08-18 06:48:58 +00:00
./setup configure --prefix=$(PREFIX) ;\
./setup build
2005-04-24 08:51:33 +00:00
EvalHaskell.h: build
2005-08-18 05:05:19 +00:00
cp src/System/Eval/Haskell_stub.h $@
2005-04-24 08:51:33 +00:00
#
# installing
#
# TODO put these in subdirs
install:
$(INSTALL_DATA_DIR) $(LIBDIR)/include
$(INSTALL_DATA) EvalHaskell.h $(LIBDIR)/include
2005-07-06 05:00:19 +00:00
$(INSTALL_DATA_DIR) $(MANDIR)/man1
$(INSTALL_DATA) docs/hs-plugins.1 $(MANDIR)/man1
2005-08-18 05:05:19 +00:00
cd src && ./setup install
2005-04-24 08:51:33 +00:00
#
# regress check. TODO check expected output
#
check:
@if [ ! -f EvalHaskell.h ] ; then \
echo "run 'make' first" ; \
exit 1 ;\
fi
@( d=/tmp/plugins.tmp.$$$$ ; mkdir $$d ; export TMPDIR=$$d ;\
for i in `find examples ! -name CVS -type d -maxdepth 2 -mindepth 2 | sort` ; do \
2005-04-24 08:51:33 +00:00
printf "=== testing %-50s ... " "$$i" ; \
( cd $$i ; if [ -f dont_test ] ; then \
echo "ignored." ;\
else ${MAKE} -sk && ${MAKE} -ksi check |\
sed '/^Compil/d;/^Load/d;/Read/d;/Expan/d;/Savi/d;/Writ/d' ;\
${MAKE} -sk clean ;\
fi ) 2> /dev/null ;\
done ; rm -rf $$d )
#
# making clean
#
CLEAN_FILES += *.conf.*.old *~
clean:
cd docs && $(MAKE) clean
2005-08-18 05:05:19 +00:00
cd src && ./setup clean 2> /dev/null || true
cd src && rm -rf dist Setup.hi Setup.o setup
2005-04-24 08:51:33 +00:00
rm -rf $(CLEAN_FILES)
find examples -name '*.a' -exec rm {} \;
find examples -name '*~' -exec rm {} \;
find examples -name 'a.out' -exec rm {} \;
find examples -name '*.hi' -exec rm {} \;
find examples -name '*.o' -exec rm {} \;
find examples -name '*.core' -exec rm {} \;
find examples -name 'package.conf' -exec rm {} \;
rm -f examples/makewith/io/TestIO.conf
rm -f examples/makewith/unsafeio/Unsafe.conf
2005-04-24 08:51:33 +00:00
rm -rf examples/hmake/lib-plugs/plugs
rm -rf examples/hmake/one-shot/runplugs
rm -f EvalHaskell.h
EXTRA_CLEANS+=*.conf.inplace* *.conf.in *.h autom4te.cache \
2005-08-19 02:43:28 +00:00
config.h config.mk config.log config.status src/plugins.cabal
2005-04-24 08:51:33 +00:00
distclean: clean
rm -rf $(EXTRA_CLEANS)
-include config.mk