Makefile: fix compile blocking issues.

- mkdir bin properly now before calling ${PROGS}
- specify $VERSION in top of file instead of inline in the compiler
master
Drake 3 years ago
parent 9a92991bf1
commit 2d787448fb
No known key found for this signature in database
GPG Key ID: 9B83455BD94F12A3

@ -1,18 +1,20 @@
VERSION = "\"0.3.2\\n© Ruthenic, 2021\""
CC ?= gcc CC ?= gcc
target ?= $(shell ${CC} -dumpmachine) target ?= $(shell ${CC} -dumpmachine)
CC_FLAGS ?= CC_FLAGS ?=
CC_FLAGS := -Ilib
PROGS ?= arch basename cat chroot cp ls pwd rm uname whoami yes PROGS ?= arch basename cat chroot cp ls pwd rm uname whoami yes
EXCLUDE_PROGS ?= rm EXCLUDE_PROGS ?= rm
DESTDIR ?= / DESTDIR ?= /
.PHONY: all debug clean build-release install .PHONY: all debug clean build-release install
all: all: $(shell mkdir -p bin)
@mkdir -p bin
all: ${PROGS} all: ${PROGS}
${PROGS}: ${PROGS}:
@echo Building $@.. @echo Building $@..
@${CC} -o bin/$@ -DDRAKECU_VERSION=\'0.3.2\\n© Ruthenic, 2021\' @${CC} -o bin/$@ -DDRAKECU_VERSION=${VERSION} ${CC_FLAGS} src/$@.c
debug: CC_FLAGS:=-g -O0 -v ${CC_FLAGS} debug: CC_FLAGS:=-g -O0 -v ${CC_FLAGS}
debug: all debug: all

Loading…
Cancel
Save