Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
clean up template a bit
  • Loading branch information
moritz committed Jun 7, 2012
1 parent 0b093de commit c94c693
Showing 1 changed file with 13 additions and 51 deletions.
64 changes: 13 additions & 51 deletions bin/ufo
Expand Up @@ -6,74 +6,36 @@ sub makefile_template() {
.PHONY: all build test install clean distclean purge
PERL6 = $binary
PREFIX = ~/.perl6
PREFIX = $(HOME)/.perl6
BLIB = blib
P6LIB = $(PWD)/$(BLIB)/lib:$(PWD)/lib:$(PERL6LIB)
CP = cp -p
$sources
$scripts
PIRS = $(patsubst %.pm6,%.pir,$(SOURCES:%.pm=%.pir))
BLIB_PIRS = $(PIRS:%=$(BLIB)/%)
BLIB_PMS = $(SOURCES:%=$(BLIB)/%)
INSTALL_SOURCES = $(SOURCES:%=$(PREFIX)/%)
INSTALL_SCRIPTS = $(SCRIPTS:%=$(PREFIX)/%)
INSTALL_PIRS = $(PIRS:%=$(PREFIX)/%)
TESTS = $(shell if [ -d 't' ]; then find t -name '*.t'; fi)
$blib_sources
$blib_pirs
all:: build
all build: $(BLIB_PIRS)
build:: $(BLIB_PMS) $(BLIB_PIRS)
$build_rules
$(BLIB)/%.pm:: %.pm
mkdir -p `dirname '$@'`
cp $< $@
$(BLIB)/%.pm6:: %.pm6
mkdir -p `dirname '$@'`
cp $< $@
$(BLIB)/%.pir:: %.pm
mkdir -p `dirname '$@'`
env PERL6LIB=$(P6LIB) $(PERL6) --target=pir --output=$@ $<
$(BLIB)/%.pir:: %.pm6
mkdir -p `dirname '$@'`
env PERL6LIB=$(P6LIB) $(PERL6) --target=pir --output=$@ $<
test:: build
test: build
env PERL6LIB=$(P6LIB) prove -e '$(PERL6)' -r t/
loudtest:: build
loudtest: build
env PERL6LIB=$(P6LIB) prove -ve '$(PERL6)' -r t/
timetest:: build
timetest: build
env PERL6LIB=$(P6LIB) PERL6_TEST_TIMES=1 prove -ve '$(PERL6)' -r t/
$(TESTS):: build
env PERL6LIB=$(P6LIB) prove -v -e '$(PERL6)' -r $@
install:: build $(INSTALL_SOURCES) $(INSTALL_PIRS) $(INSTALL_SCRIPTS)
$(PREFIX)/%.pm:: %.pm
mkdir -p `dirname '$@'`
install $< $@
$(PREFIX)/%.pm6:: %.pm6
mkdir -p `dirname '$@'`
install $< $@
$(PREFIX)/%.pir:: blib/%.pir
mkdir -p `dirname '$@'`
install $< $@
$(PREFIX)/bin/%:: bin/%
mkdir -p `dirname '$@'`
install $< $@
install: $(BLIB_PIRS)
$install_rules
clean::
clean:
rm -fr $(BLIB)
distclean purge:: clean
distclean purge: clean
rm -r Makefile
}

Expand Down

0 comments on commit c94c693

Please sign in to comment.