-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (28 loc) · 1001 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
CURDIR:=$(shell pwd)
PREFIX?="$(CURDIR)/package"
all: prepare
clean:
$(MAKE) --directory pkgbuild clean
$(MAKE) --directory dpkg clean
# Package manager formats
pkgbuild:
$(MAKE) --directory pkgbuild PREFIX=$(PREFIX) $(TARGET)
dpkg:
$(MAKE) --directory dpkg PREFIX=$(PREFIX) $(TARGET)
# Distribution to package manager mapping
arch: pkgbuild
debian: dpkg
ubuntu: dpkg
find-distribution:
$(MAKE) $(shell lsb_release --id --short | tr A-Z a-z) TARGET=$(TARGET) PREFIX=$(PREFIX)
prepare:
$(MAKE) find-distribution TARGET=prepare
source:
$(MAKE) find-distribution TARGET=source
binary:
$(MAKE) find-distribution TARGET=binary
install:
$(MAKE) find-distribution TARGET=install
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
.PHONY: pkgbuild dpkg arch debian ubuntu find-distribution list all prepare source binary clean%