X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Fparallel%2FMakefile;h=8b68d777b98a49e41c5e9e0e9e56915fd70a676f;hp=094c5cbba1f470bdec8297169381df3db0d103c0;hb=34cc75e1a62638f2833815746ebce0a9114dc26b;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1 diff --git a/utils/parallel/Makefile b/utils/parallel/Makefile index 094c5cb..8b68d77 100644 --- a/utils/parallel/Makefile +++ b/utils/parallel/Makefile @@ -1,49 +1,53 @@ TOP=../.. include $(TOP)/mk/boilerplate.mk +# +# You'll only get this with Parallel Haskell or +# GranSim.. +# +ifeq "$(BuildingParallel)" "YES" +INSTALL_PARALLEL_SCRIPTS = YES +endif +ifeq "$(BuildingGranSim)" "YES" +INSTALL_PARALLEL_SCRIPTS = YES +endif + +ifeq "$(INSTALL_PARALLEL_SCRIPTS)" "YES" + PERL_PROGS = \ grs2gr gr2qp qp2ps ghc-fool-sort ghc-unfool-sort gr2pe gr2java \ qp2ap gr2RTS RTS2gran gran-extr gp-ext-imp tf avg-RTS SPLIT \ AVG SN get_SN sn_filter ps-scale-y - BASH_PROGS = gr2ps gr2jv gr2ap gr2gran -# -# One rule fits all, not particularly selective. -# -$(PERL_PROGS) : $(patsubst %,%.pl,$(PERL_PROGS)) -$(BASH_PROGS) : $(patsubst %,%.bash,$(BASH_PROGS)) +else +PERL_PROGS = +BASH_PROGS = -all :: $(PERL_PROGS) $(BASH_PROGS) +endif -$(PERL_PROGS) : - $(RM) $@ - @echo Creating $@... - @echo "#!"$(PERL) > $@ - @cat $@.pl >> $@ - @chmod a+x $@ +PERL_INSTALLERS = $(addprefix install.perl.,$(PERL_PROGS)) +BASH_INSTALLERS = $(addprefix install.bash.,$(BASH_PROGS)) -$(BASH_PROGS) : - $(RM) $@ - @echo Creating $@... - @echo "#!"$(BASH) > $@ - @cat $@.bash >> $@ - @chmod a+x $@ +.PHONY: install.perl.% +.PHONY: install.bash.% -# -# You'll only get this with Parallel Haskell or -# GranSim.. -# -ifeq "$(BuildingParallel)" "YES" -INSTALL_SCRIPTS += $(BASH_PROGS) $(PERL_PROGS) -else -ifeq "$(BuildingGranSim)" "YES" -INSTALL_SCRIPTS += $(BASH_PROGS) $(PERL_PROGS) -endif -endif +install :: $(PERL_INSTALLERS) $(BASH_INSTALLERS) + +$(PERL_INSTALLERS): install.perl.%: + rm -f $(bindir)/$* + echo "#!$(PERL)" >> $(bindir)/$* + cat $*.pl >> $(bindir)/$* + $(EXECUTABLE_FILE) $(bindir)/$* + +$(BASH_INSTALLERS): install.bash.%: + rm -f $(bindir)/$* + echo "#!$(BASH)" >> $(bindir)/$* + cat $*.bash >> $(bindir)/$* + $(EXECUTABLE_FILE) $(bindir)/$* -CLEAN_FILES += $(BASH_PROGS) $(PERL_PROGS) +include $(TOP)/mk/bindist.mk include $(TOP)/mk/target.mk