prefix?=/usr/local cc_files=wait_for_files samizdat-pinentry cpp_files=dynmenu compiled_programs=${cc_files} ${cpp_files} CC=gcc -std=gnu99 CFLAGS=-Os all: samizdat-paths.sh ${compiled_programs} dynmenu: src/dynmenu.cpp $(CXX) $(CFLAGS) $< -o $@ -lcurses samizdat-pinentry: src/samizdat-pinentry.c $(CC) $(CFLAGS) $< -o $@ -lcurses wait_for_files: src/wait_for_files.c $(CC) $(CFLAGS) $< -o $@ 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 dnsmasq-dhcp-script.sh samizdat-password-agent samizdat-gpg-agent publish-ip.sh) samizdat-paths.sh ${cc_files} ${btrfs_utils} btrfs_utils=$(addprefix src/btrfs-utils/, btarfs btrfs-shrink with-btrfs-seed) initrd_files:=$(wildcard src/initrd/*) dynmenu samizdat-pinentry wait_for_files initramfs_conf_files:=$(wildcard initramfs-tools/*) isolinux_files:=$(wildcard isolinux/*) clean: rm -f samizdat-paths.sh ${compiled_programs} .PHONY: samizdat-paths.sh all clean samizdat-paths.sh: src/samizdat-paths.in @sed -e "s?PREFIX?$(prefix)?g" $< > $@ include samizdat-paths.sh install-configuration: ifndef instdir $(error "You must specify instdir, for safety.") else install -DT conf/dnsmasq.conf ${instdir}/etc/dnsmasq.conf install -DT conf/interfaces.d_eth0 ${instdir}/etc/network/interfaces.d/eth0 install -DT conf/network_if-up.d_samizdat ${instdir}/etc/network/if-up.d/samizdat install -DT conf/postfix_main.cf ${instdir}/etc/postfix/main.cf install -DT conf/torrc ${instdir}/etc/tor/torrc ln -sf /var/cache/kiki/config/tor/hostname ${instdir}/etc/mailname ln -sf /var/cache/kiki/config/tor/hostname ${instdir}/etc/hostname endif install: ${bin_programs} samizdat-paths.sh ${compiled_programs} install ${bin_programs} ${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} cp -r ${isolinux_files} ${instdir}${samizdat_isolinux_dir}