From a8c4ae5e924a5ee0cb13f9e21f1d0a3b422680dc Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 29 Apr 2016 18:27:06 -0400 Subject: prefix= and instdir= can be set on the make command line --- Makefile | 33 ++++++++++++++++++++------------- src/samizdat-paths.sh | 2 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 1a80964..6489f43 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,27 @@ -all: - @echo unimplemented +prefix?=/usr/local -bin_programs=$(addprefix src/, xorriso-usb.sh btrfs-functions.sh btrfs-receive-root.sh btrfs-send-root.sh var.sh grub-efi.sh keygen.sh initrd.sh samizdat-paths.sh qemu.sh) +all: samizdat-paths.sh + +bin_programs=$(addprefix src/, xorriso-usb.sh btrfs-functions.sh btrfs-receive-root.sh btrfs-send-root.sh var.sh grub-efi.sh keygen.sh initrd.sh qemu.sh) samizdat-paths.sh + +# TODO: compile these here +samizdat_execs=$(addprefix /home/d/src/samizdat/, wait_for_files samizdat-pinentry dynmenu src/samizdat-password-agent src/samizdat-gpg-agent) initrd_files:=$(wildcard src/initrd/*) initramfs_conf_files:=$(wildcard initramfs-tools/*) -include src/samizdat-paths.sh +.PHONY: samizdat-paths.sh +samizdat-paths.sh: src/samizdat-paths.in + sed -e "s?PREFIX?$(prefix)?g" $< > $@ +include samizdat-paths.sh install: - install ${bin_programs} ${samizdat_bindir} - mkdir -p ${samizdat_initrd_files_dir} - mkdir -p ${samizdat_child_dir} - mkdir -p ${samizdat_grub_efi_dir} - mkdir -p ${samizdat_initramfs_conf_dir} - mkdir -p ${samizdat_isolinux_dir} - mkdir -p ${samizdat_linux_dir} - cp -r ${initrd_files} ${samizdat_initrd_files_dir} - cp -r ${initramfs_conf_files} ${samizdat_initramfs_conf_dir} + install ${bin_programs} ${samizdat_execs} ${instdir}${samizdat_bindir} + mkdir -p ${instdir}${samizdat_initrd_files_dir} + mkdir -p ${instdir}${samizdat_child_dir} + mkdir -p ${instdir}${samizdat_grub_efi_dir} + mkdir -p ${instdir}${samizdat_initramfs_conf_dir} + mkdir -p ${instdir}${samizdat_isolinux_dir} + mkdir -p ${instdir}${samizdat_linux_dir} + cp -r ${initrd_files} ${instdir}${samizdat_initrd_files_dir} + cp -r ${initramfs_conf_files} ${instdir}${samizdat_initramfs_conf_dir} diff --git a/src/samizdat-paths.sh b/src/samizdat-paths.sh index fc6468d..6548564 100644 --- a/src/samizdat-paths.sh +++ b/src/samizdat-paths.sh @@ -10,4 +10,4 @@ samizdat_bindir=/usr/local/bin samizdat_initramfs_conf_dir=${samizdat_libdir}/initramfs-tools samizdat_iso_dir=. -samizdat_execs_dir=/home/d/src/samizdat +samizdat_execs_dir=${samizdat_bindir} -- cgit v1.2.3