SHELL = /bin/sh # Folders SRC=../app SRC_PROXY=$(SRC)/src CNF_PROXY=$(SRC)/config DST=rootfs DST_PROXY=$(DST)/home/proxy # collect source files SRC_FILES := $(wildcard $(SRC_PROXY)/*.py)\ $(wildcard $(SRC_PROXY)/*.ini)\ $(wildcard $(SRC_PROXY)/gen3/*.py)\ $(wildcard $(SRC_PROXY)/gen3plus/*.py) CNF_FILES := $(wildcard $(CNF_PROXY)/*.toml) # determine destination files TARGET_FILES = $(SRC_FILES:$(SRC_PROXY)/%=$(DST_PROXY)/%) CONFIG_FILES = $(CNF_FILES:$(CNF_PROXY)/%=$(DST_PROXY)/%) build: rootfs clean: rm -r -f $(DST_PROXY) rm -f $(DST)/requirements.txt rootfs: $(TARGET_FILES) $(CONFIG_FILES) $(DST)/requirements.txt .PHONY: build clean rootfs $(CONFIG_FILES): $(DST_PROXY)/% : $(CNF_PROXY)/% @echo Copy $< to $@ @mkdir -p $(@D) @cp $< $@ $(TARGET_FILES): $(DST_PROXY)/% : $(SRC_PROXY)/% @echo Copy $< to $@ @mkdir -p $(@D) @cp $< $@ $(DST)/requirements.txt : $(SRC)/requirements.txt @echo Copy $< to $@ @cp $< $@