From 2d787448fb4fbbb07c4a4f36416f4ae58a93e7f5 Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Thu, 21 Oct 2021 14:09:24 -0400 Subject: [PATCH] Makefile: fix compile blocking issues. - mkdir bin properly now before calling ${PROGS} - specify $VERSION in top of file instead of inline in the compiler --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 92c64d9..6fed482 100644 --- a/Makefile +++ b/Makefile @@ -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