]> git.plutz.net Git - rpi_small/blobdiff - Makefile
modular config for touch screen
[rpi_small] / Makefile
index 6a35118c906b0f6990c563898a7282a5f61cdf14..fe8971e098bedfdbcd937ec3996e5e433d40b237 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,8 +20,8 @@
 BOOTSTRAP = http://raspbian.raspberrypi.org/raspbian
 
 define SOURCES = 
-deb    http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi\n\
-deb    http://archive.raspberrypi.org/debian stretch main\n
+deb    http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi
+deb    http://archive.raspberrypi.org/debian stretch main
 endef
 
 PACKAGES := apt bluez bluez-firmware bluez-tools btrfs-tools busybox-static bzip2 ca-certificates cron debian-archive-keyring deborphan firmware-brcm80211 firmware-linux-free firmware-misc-nonfree gzip htop ifupdown init iputils-ping irqbalance isc-dhcp-client less libraspberrypi-bin libraspberrypi0 make net-tools nmap ntpdate openssh-client openssh-server pi-bluetooth raspberrypi-bootloader raspberrypi-kernel rsync ssh sshfs sudo systemd traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip
@@ -30,15 +30,14 @@ PACKAGES := apt bluez bluez-firmware bluez-tools btrfs-tools busybox-static bzip
 WIFI-SSID = 
 WIFI-PASS = 
 
+IMGFILE = raspi.img
+
 config.mk: config.example
        cp -n "$<" "$@"
+include config.mk
 
 .PHONY: imgfile imgmount root_copy norecommends apt_keys
-
-IMGFILE = raspi.img
-
-include config.mk
-include *.mk
+export SOURCES
 
 raspi_root:
        btrfs subvolume create "$@" || mkdir "$@"
@@ -55,13 +54,13 @@ raspi_root/etc/apt/apt.conf.d/10norecommends: raspi_root
        printf 'APT::Install-Recommends "false";\n' >"$@"
        chmod 644 "$@"
 
-apt_keys:
-       -chroot "$@" apt-key add - <./raspbian-archive-keyring.gpg
-       -chroot "$@" apt-key add - <./raspberrypi-archive-keyring.gpg
-       -chroot "$@" apt-key add - <./debian-archive-stretch-stable.gpg
+apt_keys: raspi_root
+       -chroot "$<" apt-key add - <./raspbian-archive-keyring.gpg
+       -chroot "$<" apt-key add - <./raspberrypi-archive-keyring.gpg
+       -chroot "$<" apt-key add - <./debian-archive-stretch-stable.gpg
 
 raspi_root/: raspi_root norecommends apt_keys .FORCE
-       printf '${SOURCES}' >$@/etc/apt/sources.list
+       printf %s "$$SOURCES" >$@/etc/apt/sources.list
        -cp /etc/resolv.conf "$@etc/"
        -chroot "$@" sh -c 'apt-mark showmanual |xargs apt-mark auto'
        -chroot "$@" apt-get update