build: Make builds more modular
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -2,28 +2,13 @@
|
|||||||
# Copyright (c) 2026, Chloe M.
|
# Copyright (c) 2026, Chloe M.
|
||||||
# Provided under the BSD-3 clause
|
# Provided under the BSD-3 clause
|
||||||
#
|
#
|
||||||
# Description: CUMHOLE build script
|
# Description: Top-level build script
|
||||||
# Author: Chloe M.
|
# Author: Chloe M.
|
||||||
#
|
#
|
||||||
|
|
||||||
.SILENT:
|
|
||||||
PROMPT := printf "%s\t\t%s\n"
|
|
||||||
|
|
||||||
CC = gcc
|
|
||||||
CFILES = $(shell find . -name "*.c")
|
|
||||||
OFILES = $(CFILES:.c=.o)
|
|
||||||
|
|
||||||
CFLAGS = \
|
|
||||||
-Wall \
|
|
||||||
-pedantic
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: hole
|
all: core
|
||||||
|
|
||||||
.PHONY: hole
|
.PHONY: core
|
||||||
hole: $(OFILES)
|
core:
|
||||||
$(CC) $^ -o $@
|
cd core/; $(MAKE)
|
||||||
|
|
||||||
%.o: %.c
|
|
||||||
$(PROMPT) "CC" $<
|
|
||||||
$(CC) -c $(CFLAGS) $< -o $@
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2026, Chloe M.
|
||||||
|
# Provided under the BSD-3 clause
|
||||||
|
#
|
||||||
|
# Description: CUMHOLE build script
|
||||||
|
# Author: Chloe M.
|
||||||
|
#
|
||||||
|
|
||||||
|
include ../mk/global.mk
|
||||||
|
.SILENT:
|
||||||
|
|
||||||
|
CFILES = $(shell find . -name "*.c")
|
||||||
|
OFILES = $(CFILES:.c=.o)
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: ../hole
|
||||||
|
|
||||||
|
.PHONY: hole
|
||||||
|
../hole: $(OFILES)
|
||||||
|
$(CC) $^ -o $@
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) -c $(CFLAGS) $< -o $@
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2026, Chloe M.
|
||||||
|
# Provided under the BSD-3 clause
|
||||||
|
#
|
||||||
|
# Description: CUMHOLE global vars
|
||||||
|
# Author: Chloe M.
|
||||||
|
#
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
CFLAGS = \
|
||||||
|
-Wall \
|
||||||
|
-pedantic
|
||||||
Reference in New Issue
Block a user