feat(version): added support for building version information
This commit is contained in:
13
Makefile
13
Makefile
@@ -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 $@ $^
|
||||
|
Reference in New Issue
Block a user