abuild/Makefile

44 lines
1.1 KiB
Makefile
Raw Normal View History

2008-10-18 08:09:24 +00:00
PACKAGE=abuild
VERSION:=$(shell awk -F= '$$1 == "abuild_ver" {print $$2}' abuild)
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 \
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"
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)
for i in $(USR_BIN_FILES); do\
install -m 755 $$i $(DESTDIR)/$(prefix)/bin/$$i;\
done
if [ -n "$(DESTDIR)" ] || [ ! -f "/$(sysconfdir)"/abuild.conf ]; then\
cp abuild.conf $(DESTDIR)/$(sysconfdir)/; \
fi
cp $(SAMPLES) $(DESTDIR)/$(prefix)/share/abuild
2009-01-03 10:05:12 +00:00
cp functions.sh $(DESTDIR)/$(datadir)/
2009-03-25 09:35:46 +00:00
cp initamfs-init $(DESTDIR)/$(datadir)/
2008-10-18 08:09:24 +00:00
dist: $(P).tar.bz2
2008-10-18 08:09:24 +00:00
$(P).tar.bz2: $(DISTFILES)
2008-10-18 08:09:24 +00:00
rm -rf $(P)
mkdir -p $(P)
cp $(DISTFILES) $(P)/
tar -cjf $@ $(P)
2008-10-18 08:09:24 +00:00
rm -rf $(P)
.PHONY: install dist