-
Notifications
You must be signed in to change notification settings - Fork 54
/
Makefile
28 lines (23 loc) · 877 Bytes
/
Makefile
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
PACKVERSION := $(shell cat VERSION 2>/dev/null || git describe --long)
prefix ?= /usr
bindir ?= $(prefix)/bin
datadir ?= $(prefix)/share
all:
$(DESTDIR)$(bindir)/:
mkdir -p $@
$(DESTDIR)$(bindir)/packpack: packpack $(DESTDIR)$(bindir)/
install -pm0755 $< $@
sed -i $@ \
-e 's#PACKVERSION=.*#PACKVERSION=$(PACKVERSION)#' \
-e 's#PACKDIR=.*#PACKDIR=$(datadir)/packpack#'
$(DESTDIR)$(datadir)/packpack/:
mkdir -p $@
$(DESTDIR)$(datadir)/packpack/%: pack/% $(DESTDIR)$(datadir)/packpack/
install -pm0644 pack/$(notdir $@) $(dir $@)
install: $(DESTDIR)$(bindir)/packpack \
$(DESTDIR)$(datadir)/packpack/Makefile \
$(DESTDIR)$(datadir)/packpack/config.mk \
$(DESTDIR)$(datadir)/packpack/tarball.mk \
$(DESTDIR)$(datadir)/packpack/deb.mk \
$(DESTDIR)$(datadir)/packpack/rpm.mk \
$(DESTDIR)$(datadir)/packpack/apk.mk