Makefile 824 Bytes
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2

PACKAGE=abuild
3 4
VERSION:=$(shell  awk -F= '$$1 == "abuild_ver" {print $$2}' abuild)
DISTFILES=Makefile abuild abuild.conf APKBUILD.proto buildrepo
Natanael Copa's avatar
Natanael Copa committed
5 6 7

prefix ?= /usr
sysconfdir ?= /etc
8
datadir ?= $(prefix)/share/$(PACKAGE)
Natanael Copa's avatar
Natanael Copa committed
9 10 11 12 13 14 15 16

P=$(PACKAGE)-$(VERSION)

help:
	@echo "$(P) makefile"
	@echo "usage: make install [ DESTDIR=<path> ]"
	@echo "       make dist"

17
install: abuild abuild.conf APKBUILD.proto functions.sh
Natanael Copa's avatar
Natanael Copa committed
18
	mkdir -p $(DESTDIR)/$(prefix)/bin $(DESTDIR)/$(sysconfdir) \
19
		$(DESTDIR)/$(datadir)
20
	cp abuild buildrepo $(DESTDIR)/$(prefix)/bin/
Natanael Copa's avatar
Natanael Copa committed
21
	cp abuild.conf $(DESTDIR)/$(sysconfdir)/
Natanael Copa's avatar
Natanael Copa committed
22
	cp APKBUILD.proto $(DESTDIR)/$(prefix)/share/abuild
23
	cp functions.sh $(DESTDIR)/$(datadir)/
Natanael Copa's avatar
Natanael Copa committed
24 25 26 27 28 29 30 31 32 33 34

dist:	$(P).tar.gz

$(P).tar.gz:	$(DISTFILES)
	rm -rf $(P)
	mkdir -p $(P)
	cp $(DISTFILES) $(P)/
	tar -czf $@ $(P)
	rm -rf $(P)

.PHONY: install dist