-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (43 loc) · 1.42 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
SHELL=/bin/bash
BRANCH=$(shell date +%Y.%m)
BUILDNUM=1
BUILD=$(BRANCH)-$(shell printf "%03d" $(BUILDNUM))
SRCDIR=$(shell pwd)/src
DEBDEST=$(shell pwd)/debs
# This should match pbx-kernel-builder
KERNELVER=6.6.25
KERNELREL=1
export KERNELVER KERNELREL BRANCH BUILDNUM BUILD SRCDIR
# Anything here can be automatically made by the $(MKDIRS) target below
MKDIRS=$(SRCDIR) $(DEBDEST)
# Things that are always needed
TOOLS += curl vim ping wget netstat syslinux figlet toilet
PKG_ping=iputils-ping
PKG_netstat=net-tools
# This is first so we always have a default that is harmless (assuming
# you think that 'make setup' is harmless, which I think it is!)
.PHONY: halp
halp: setup
@echo "No help yet"
# Drag in any includes
include Makefile.settings
include $(wildcard includes/Makefile.*)
# This is anything that's in TOOLS or STOOLS
PKGS=$(addprefix /usr/bin/,$(TOOLS))
SPKGS=$(addprefix /usr/sbin/,$(STOOLS))
STARGETS += $(PKGS) $(SPKGS)
# And now trigger them
.PHONY: setup
setup: $(STARGETS) $(PREREQS) | $(SRCDIR)
@echo "Prereqs are $(PREREQS)"
build: setup $(PREREQS)
@echo "Builds are $(PREREQS)"
.PHONY: debug
debug:
@echo "I want to trigger $(STARGETS) in setup"
# This installs whatever is needed by PKGS or SPKGS
/usr/bin/% /usr/sbin/%:
p="$(PKG_$*)"; p=$${p:=$*}; apt-get -y install $$p || ( echo "Don't know how to install $*, fix the makefile"; exit 1 )
# Just make anything in MKDIRS, easy DRY.
$(MKDIRS):
mkdir -p $@