# 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