Makefile : skill issue
This commit is contained in:
parent
d44d8ddd8c
commit
4f74bfcb46
1 changed files with 6 additions and 4 deletions
10
Makefile
10
Makefile
|
@ -7,6 +7,7 @@ SUDO_QEMU := sudo -u $(QEMU_USER)
|
|||
|
||||
QEMUSH := /usr/local/bin/$(NAME)
|
||||
SRC_QEMUSH := bin/$(NAME)
|
||||
SRCD := src
|
||||
|
||||
# This repo's equivalent of effective qemu Unix user home
|
||||
SRC_QEMU_HOME := qemu
|
||||
|
@ -26,9 +27,9 @@ BINS_MODE := 740
|
|||
CC := cc
|
||||
CC_OPTIONS = -O3
|
||||
# C sources file format
|
||||
SRC_FMT := c
|
||||
SRC_FMT := .c
|
||||
# Names of C programs to compile
|
||||
SRC_C_SOURCES_NAMES := $(notdir $(basename $(wildcard $(SRCD)/*.$(SRC_FMT))))
|
||||
SRC_C_SOURCES_NAMES := $(notdir $(basename $(wildcard $(SRCD)/*$(SRC_FMT))))
|
||||
# Location of C binaries
|
||||
C_BINARIES := $(addprefix $(QEMU_BIN)/,$(SRC_C_SOURCES_NAMES))
|
||||
|
||||
|
@ -40,6 +41,7 @@ all: $(QEMUSH_DIRS) $(MODULES) $(C_BINARIES) $(QEMUSH)
|
|||
|
||||
$(QEMUSH_DIRS):
|
||||
$(SUDO_QEMU) mkdir -p $@
|
||||
$(SUDO_QEMU) chmod 750 $@
|
||||
|
||||
$(QEMUSH): $(SRC_QEMUSH)
|
||||
sudo install -m 755 $^ $@
|
||||
|
@ -47,6 +49,6 @@ $(QEMUSH): $(SRC_QEMUSH)
|
|||
$(MODULES): $(QEMU_HOME)%: $(SRC_QEMU_HOME)%
|
||||
$(SUDO_QEMU) install -m $(BINS_MODE) $^ $@
|
||||
|
||||
$(C_BINARIES): $(QEMU_BIN)%: $(SRCD)/%.$(SRC_FMT)
|
||||
$(SUDO_QEMU) $(QEMU_USER) $(CC) $(CC_OPTIONS) -o $@ $^
|
||||
$(C_BINARIES): $(QEMU_BIN)%: $(SRCD)%$(SRC_FMT)
|
||||
$(SUDO_QEMU) $(CC) $(CC_OPTIONS) -o $@ $^
|
||||
$(SUDO_QEMU) chmod $(BINS_MODE) $@
|
||||
|
|
Loading…
Reference in a new issue