2008-10-18 08:09:24 +00:00
|
|
|
|
|
|
|
PACKAGE=abuild
|
2009-01-06 15:40:21 +00:00
|
|
|
VERSION:=$(shell awk -F= '$$1 == "abuild_ver" {print $$2}' abuild)
|
2009-01-15 15:48:16 +00:00
|
|
|
USR_BIN_FILES=abuild devbuild mkalpine buildrepo
|
2009-03-06 17:51:53 +00:00
|
|
|
SAMPLES=sample.APKBUILD sample.initd sample.confd sample.pre-install \
|
|
|
|
sample.post-install
|
2009-03-25 09:35:46 +00:00
|
|
|
DISTFILES=$(USR_BIN_FILES) $(SAMPLES) Makefile abuild.conf initramfs-init \
|
2009-01-15 15:48:16 +00:00
|
|
|
|
2008-10-18 08:09:24 +00:00
|
|
|
|
|
|
|
prefix ?= /usr
|
|
|
|
sysconfdir ?= /etc
|
2009-01-03 10:05:12 +00:00
|
|
|
datadir ?= $(prefix)/share/$(PACKAGE)
|
2008-10-18 08:09:24 +00:00
|
|
|
|
|
|
|
P=$(PACKAGE)-$(VERSION)
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "$(P) makefile"
|
|
|
|
@echo "usage: make install [ DESTDIR=<path> ]"
|
|
|
|
@echo " make dist"
|
|
|
|
|
2009-01-29 09:06:43 +00:00
|
|
|
install: $(USR_BIN_FILES) $(SAMPLES) abuild.conf functions.sh
|
2008-10-30 15:55:25 +00:00
|
|
|
mkdir -p $(DESTDIR)/$(prefix)/bin $(DESTDIR)/$(sysconfdir) \
|
2009-01-03 10:05:12 +00:00
|
|
|
$(DESTDIR)/$(datadir)
|
2009-01-15 15:48:16 +00:00
|
|
|
for i in $(USR_BIN_FILES); do\
|
|
|
|
install -m 755 $$i $(DESTDIR)/$(prefix)/bin/$$i;\
|
|
|
|
done
|
2009-01-19 09:19:20 +00:00
|
|
|
if [ -n "$(DESTDIR)" ] || [ ! -f "/$(sysconfdir)"/abuild.conf ]; then\
|
2009-01-07 18:29:19 +00:00
|
|
|
cp abuild.conf $(DESTDIR)/$(sysconfdir)/; \
|
|
|
|
fi
|
2009-01-29 09:06:43 +00:00
|
|
|
cp $(SAMPLES) $(DESTDIR)/$(prefix)/share/abuild
|
2009-01-03 10:05:12 +00:00
|
|
|
cp functions.sh $(DESTDIR)/$(datadir)/
|
2009-03-27 15:22:30 +00:00
|
|
|
cp initramfs-init $(DESTDIR)/$(datadir)/
|
2008-10-18 08:09:24 +00:00
|
|
|
|
2009-01-15 15:48:16 +00:00
|
|
|
dist: $(P).tar.bz2
|
2008-10-18 08:09:24 +00:00
|
|
|
|
2009-01-15 15:48:16 +00:00
|
|
|
$(P).tar.bz2: $(DISTFILES)
|
2008-10-18 08:09:24 +00:00
|
|
|
rm -rf $(P)
|
|
|
|
mkdir -p $(P)
|
|
|
|
cp $(DISTFILES) $(P)/
|
2009-01-15 15:48:16 +00:00
|
|
|
tar -cjf $@ $(P)
|
2008-10-18 08:09:24 +00:00
|
|
|
rm -rf $(P)
|
|
|
|
|
|
|
|
.PHONY: install dist
|