Makefile revision 78f51585b9ef1095880ddd235a8d41ff9e152fc5
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich# utils/DrIFT-src/Makefile
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich# $Id$
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich# Author: Klaus L�ttich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich# Year: 2002
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maeder# A Makefile to compile DrIFT in a comfortable way for various plattforms.
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich####################################################################
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich## include The uname variable
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettichifneq ($(MAKECMDGOALS),install)
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettichinclude uname.mk
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettichendif
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich####################################################################
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich## Some varibles, which control the compilation
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus LuettichHC = ghc
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus LuettichPERL = perl
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich####################################################################
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich# source
7581ae710aa768abfd56e35646bf8ebe048aba94Klaus Luettichsources = DrIFT.hs
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich####################################################################
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich### targets
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maedermacintosh: DrIFT.macintosh
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maeder
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettichsolaris: DrIFT.solaris
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettichlinux: DrIFT.linux
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus LuettichDrIFT.$(UNAME): DrIFT.tmp
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich mv DrIFT.tmp $@
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maederinstall: DrIFT.linux DrIFT.solaris DrIFT.macintosh
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich cp $^ ..
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus LuettichDrIFT.tmp: $(sources)
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich rm -f DrIFT.tmp
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich $(HC) --make -o $@ $<
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich rm -f uname.mk
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich### clean up
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich.PHONY : clean clean-bin
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettichclean:
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich rm -f DrIFT.tmp uname.mk *.hi *.o
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettichclean-bin: clean
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich rm -f DrIFT.solaris DrIFT.linux
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich#########################################################
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettichuname.mk:
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich rm -f $@
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich $(PERL) -e '$$un=`uname`;print "UNAME=";\
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maeder $$un =~ m"Darwin" && do {print "macintosh"};\
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich $$un =~ m"SunOS" && do {print "solaris"};\
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich $$un =~ m"Linux" && do {print "linux"};\
2c46a8a5b3e825d6d49513c691a55729414c2308Klaus Luettich print "\n"' > $@