Makefile : cible pour les launchers

This commit is contained in:
Ahurac 2023-12-13 13:00:20 +01:00
parent 6b0475ad4e
commit 9374734905

View file

@ -12,14 +12,20 @@ SRCD := src
# This repo's equivalent of effective qemu Unix user home # This repo's equivalent of effective qemu Unix user home
SRC_QEMU_HOME := qemu SRC_QEMU_HOME := qemu
SRC_QEMU_BIN := $(SRC_QEMU_HOME)/bin SRC_QEMU_BIN := $(SRC_QEMU_HOME)/bin
SRC_LAUNCHERSD := $(SRC_QEMU_HOME)/launchers
# Actual qemu Unix user home # Actual qemu Unix user home
QEMU_HOME := $(shell echo ~$(QEMU_USER)) QEMU_HOME := $(shell echo ~$(QEMU_USER))
QEMU_BIN := $(QEMU_HOME)/bin QEMU_BIN := $(QEMU_HOME)/bin
LAUNCHERSD := $(QEMU_HOME)/launchers
# Names of all qemush modules # Names of all qemush modules
SRC_MODULES_NAMES := $(notdir $(wildcard $(SRC_QEMU_BIN)/*)) SRC_MODULES_NAMES := $(notdir $(wildcard $(SRC_QEMU_BIN)/*))
# Target location of modules # Target location of modules
MODULES := $(addprefix $(QEMU_BIN)/,$(SRC_MODULES_NAMES)) MODULES := $(addprefix $(QEMU_BIN)/,$(SRC_MODULES_NAMES))
# Names of launchers scripts
SRC_LAUNCHERS_NAMES := $(notdir $(wildcard $(SRC_LAUNCHERSD)/*))
# Target location of launchers
LAUNCHERS := $(addprefix $(LAUNCHERSD)/,$(SRC_LAUNCHERS_NAMES))
# Mode to apply # Mode to apply
BINS_MODE := 740 BINS_MODE := 740
@ -37,7 +43,7 @@ C_BINARIES := $(addprefix $(QEMU_BIN)/,$(SRC_C_SOURCES_NAMES))
QEMUSH_DIRS_NAMES := bin launchers images QEMUSH_DIRS_NAMES := bin launchers images
QEMUSH_DIRS := $(addprefix $(QEMU_HOME)/,$(QEMUSH_DIRS_NAMES)) QEMUSH_DIRS := $(addprefix $(QEMU_HOME)/,$(QEMUSH_DIRS_NAMES))
all: $(QEMUSH_DIRS) $(MODULES) $(C_BINARIES) $(QEMUSH) install: $(QEMUSH_DIRS) $(MODULES) $(C_BINARIES) $(QEMUSH) $(LAUNCHERS)
$(QEMUSH_DIRS): $(QEMUSH_DIRS):
$(SUDO_QEMU) mkdir -p $@ $(SUDO_QEMU) mkdir -p $@
@ -52,3 +58,6 @@ $(MODULES): $(QEMU_HOME)%: $(SRC_QEMU_HOME)%
$(C_BINARIES): $(QEMU_BIN)%: $(SRCD)%$(SRC_FMT) $(C_BINARIES): $(QEMU_BIN)%: $(SRCD)%$(SRC_FMT)
$(SUDO_QEMU) $(CC) $(CC_OPTIONS) -o $@ $^ $(SUDO_QEMU) $(CC) $(CC_OPTIONS) -o $@ $^
$(SUDO_QEMU) chmod $(BINS_MODE) $@ $(SUDO_QEMU) chmod $(BINS_MODE) $@
$(LAUNCHERS): $(LAUNCHERSD)%: $(SRC_LAUNCHERSD)%
$(SUDO_QEMU) install -m $(BINS_MODE) $^ $@