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
target ?= $(shell ${CC} -dumpmachine)
CC_FLAGS ?=
CC_FLAGS := -Ilib
PROGS ?= arch basename cat chroot cp ls pwd rm uname whoami yes
EXCLUDE_PROGS ?= rm
DESTDIR ?= /
.PHONY: all debug clean build-release install
all:
@mkdir -p bin
all: $(shell mkdir -p bin)
all: ${PROGS}
${PROGS}:
@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: all

Loading…
Cancel
Save