Makefile revision b1d984326e2a2331403d7e4f0b0668a16d311c4a
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync# utils/DrIFT-src/Makefile
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync# $Id$
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync# Author: Klaus L�ttich
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync# Year: 2002
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync# A Makefile to compile DrIFT in a comfortable way for various plattforms.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync####################################################################
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync## include The uname variable
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncifneq ($(MAKECMDGOALS),install)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncinclude uname.mk
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncendif
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync####################################################################
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync## Some varibles, which control the compilation
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncHC = ghc
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncPERL = perl
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync####################################################################
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync# source
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncsources = DrIFT.hs
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync####################################################################
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync### targets
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncDrIFT.$(UNAME): DrIFT.tmp
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync mv DrIFT.tmp $@
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncinstall: DrIFT.$(UNAME)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync cp $^ ..
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncDrIFT.tmp: $(sources)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync rm -f DrIFT.tmp
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync $(HC) -Wall --make -o $@ $<
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync rm -f uname.mk
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync### clean up
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync.PHONY : clean clean-bin
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncclean:
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync rm -f DrIFT.tmp uname.mk *.hi *.o
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncclean-bin: clean
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync rm -f DrIFT.solaris DrIFT.linux DrIFT.macintosh
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#########################################################
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncuname.mk:
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync rm -f $@
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync $(PERL) -e '$$un=`uname`;print "UNAME=";\
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync $$un =~ m"Darwin" && do {print "macintosh"};\
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync $$un =~ m"SunOS" && do {print "solaris"};\
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync $$un =~ m"Linux" && do {print "linux"};\
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync print "\n"' > $@
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync