set up the build, the viewer window and the vsmv cli
The generator must reproduce .NET arithmetic bit for bit, so every unit builds with -ffp-contract=off and -fwrapv. Nuklear goes through the SDL3_Renderer backend, keeping the viewer off macOS's deprecated GL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
40
Makefile
Normal file
40
Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
# The generator has to reproduce .NET arithmetic bit for bit, so every
|
||||
# unit is built without FMA contraction (clang on arm64 fuses a*b+c,
|
||||
# .NET does not) and with wrapping signed overflow (C# is unchecked).
|
||||
SEXC ?= $(HOME)/dev/sex/sexc
|
||||
CFLAGS ?= -O2 -g
|
||||
CFLAGS += -std=c11 -Wall -ffp-contract=off -fwrapv
|
||||
CPPFLAGS += -Isrc -Ithird_party/nuklear -IcJSON $(shell pkg-config --cflags sdl3)
|
||||
SDL_LIBS := $(shell pkg-config --libs sdl3)
|
||||
|
||||
B = build
|
||||
|
||||
all: $(B)/vsmv $(B)/vs-map-viewer
|
||||
|
||||
# sexc writes no dependency files, and an import pastes the imported
|
||||
# module's public forms into the importer, so any Sex source may change
|
||||
# any Sex object.
|
||||
SEX_SRC := $(wildcard src/*.sex)
|
||||
|
||||
$(B)/%.o: src/%.sex $(SEX_SRC) | $(B)
|
||||
$(SEXC) $< -c -o $@ -- $(CFLAGS) $(CPPFLAGS)
|
||||
|
||||
$(B)/nk.o: src/nk.c src/nk.h | $(B)
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
|
||||
|
||||
$(B)/cJSON.o: cJSON/cJSON.c cJSON/cJSON.h | $(B)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(B)/vsmv: $(B)/vsmv.o $(B)/cJSON.o
|
||||
$(CC) $^ -o $@ -lsqlite3
|
||||
|
||||
$(B)/vs-map-viewer: $(B)/viewer.o $(B)/nk.o
|
||||
$(CC) $^ -o $@ $(SDL_LIBS)
|
||||
|
||||
$(B):
|
||||
mkdir -p $@
|
||||
|
||||
clean:
|
||||
rm -rf $(B)
|
||||
|
||||
.PHONY: all clean
|
||||
Reference in New Issue
Block a user