Makefile revision 426b139bac49aa9cc340bb089481af0f7281c04a
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maeder# A Makefile to compile genRules in a comfortable way for various plattforms.
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers####################################################################
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers## include The uname variable
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckersifneq ($(MAKECMDGOALS),install)
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckersinclude uname.mk
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckersendif
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers####################################################################
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers## Some varibles, which control the compilation
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix ReckersHC = ghc
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix ReckersPERL = perl
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers####################################################################
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers# source
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckerssources = GenerateRules.hs
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers####################################################################
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers### targets
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maedermacintosh: genRules.macintosh
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maeder
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckerssolaris: genRules.solaris
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckerslinux: genRules.linux
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix ReckersgenRules.$(UNAME): genRules.tmp
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers mv genRules.tmp $@
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maederinstall: genRules.linux genRules.solaris genRules.macintosh
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers cp $^ ..
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix ReckersgenRules.tmp: $(sources)
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers rm -f genRules.tmp
426b139bac49aa9cc340bb089481af0f7281c04aKlaus Luettich $(HC) --make -package text -i../..:../DrIFT-src -o $@ $<
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers rm -f uname.mk
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers### clean up
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers.PHONY : clean clean-bin
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckersclean:
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers rm -f genRules.tmp uname.mk *.hi *.o
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckersclean-bin: clean
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers rm -f genRules.solaris genRules.linux
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers#########################################################
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckersuname.mk:
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers rm -f $@
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers $(PERL) -e '$$un=`uname`;print "UNAME=";\
78f51585b9ef1095880ddd235a8d41ff9e152fc5Christian Maeder $$un =~ m"Darwin" && do {print "macintosh"};\
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers $$un =~ m"SunOS" && do {print "solaris"};\
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers $$un =~ m"Linux" && do {print "linux"};\
2363f62e2f4f9e42bd99d5276f237093a7801f2dFelix Reckers print "\n"' > $@