Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a82c0d9a72
Fetching contributors…

Cannot retrieve contributors at this time

file 69 lines (51 sloc) 1.564 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
.PHONY: all build test install clean distclean purge

PERL6 = perl6
PREFIX = ~/.perl6
BLIB = blib
P6LIB = $(PWD)/$(BLIB)/lib:$(PWD)/lib:$(PERL6LIB)

SOURCES=lib/NativeCall.pm6
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)

PARROT_BUILD_DIR = $(shell parrot_config build_dir)
DYNEXT_DIR = $(PARROT_BUILD_DIR)/runtime/parrot/dynext

all:: build

build:: $(BLIB_PIRS) $(BLIB_PMS)

$(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
env PERL6LIB=$(P6LIB) LD_LIBRARY_PATH=$(DYNEXT_DIR) prove -e '$(PERL6)' -r t/

$(TESTS):: build
env PERL6LIB=$(P6LIB) LD_LIBRARY_PATH=$(DYNEXT_DIR) 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 $< $@

clean::
rm -fr $(BLIB)

distclean purge:: clean
rm -r Makefile
Something went wrong with that request. Please try again.