feat(version): added support for building version information

This commit is contained in:
2025-08-06 16:20:43 -05:00
parent 57e8c4a499
commit 97af579397
4 changed files with 36 additions and 2 deletions

View File

@@ -3,7 +3,10 @@
# Makefile for Amber's BBS Interface
# Buildsys by Gale Faraday
.PHONY: all clean run
# `generate` must be called before `all` to build version information and other
# machine generated files.
.PHONY: all clean run generate
.SUFFIXES:
.DEFAULT_GOAL := all
@@ -11,6 +14,7 @@
TARGET := $(shell basename $(CURDIR))
SOURCES := src/
BUILD := build/
GENABLES := $(SOURCES)version.c
OBJS := $(patsubst $(SOURCES)%.c,$(BUILD)%.o,$(wildcard $(SOURCES)*.c))
EXECUTABLE := $(TARGET)
@@ -27,7 +31,12 @@ run: $(EXECUTABLE)
.IGNORE: clean
clean:
@rm -rvf $(BUILD) $(EXECUTABLE)
@rm -rvf $(BUILD) $(EXECUTABLE) $(GENABLES)
generate: $(GENABLES)
$(GENABLES): genver.sh
./genver.sh
$(EXECUTABLE): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $^