commit a9cc2b9854e66f6a161ddf92c268897ee0435216 parent 989e933fc557cbc1e9e16e45033387816ee6075e Author: Sebastiano Tronto <sebastiano@tronto.net> Date: Fri, 27 Oct 2023 17:20:31 +0200 Set up for compile-time options Diffstat:
M | Makefile | | | 8 | +++++--- |
A | config.mk | | | 1 | + |
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,5 +1,7 @@ # See LICENSE file for copyright and license details. +include config.mk + CFLAGS = -std=c99 -pthread -pedantic -Wall -Wextra \ -Wno-unused-parameter -O3 DBGFLAGS = -DDEBUG -std=c99 -pthread -pedantic -Wall -Wextra \ @@ -8,13 +10,13 @@ DBGFLAGS = -DDEBUG -std=c99 -pthread -pedantic -Wall -Wextra \ CC = cc -all: solve +all: cube.o debugcube.o cube.o: clean - ${CC} ${CFLAGS} -c -o cube.o src/*.c + ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c debugcube.o: - ${CC} ${DBGFLAGS} -c -o debugcube.o src/*.c + ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c clean: rm -rf *.o diff --git a/config.mk b/config.mk @@ -0,0 +1 @@ +CUBETYPE = CUBE_$(TYPE)