One base layer is drawn opaque and any number of overlays over it, so rocks can be looked for on top of the terrain rather than instead of it. Settings and rock finding live in fixed panels beside the map, not in windows over it. What is under the cursor is worked out on a thread of its own, since computing it per frame stalled the window. Find nearest searches regions outward from the view's centre and stops once no nearer region is left; probes leave pins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
1.8 KiB
Makefile
52 lines
1.8 KiB
Makefile
# 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 -Ithird_party/stb -IcJSON $(shell pkg-config --cflags sdl3)
|
|
# Sex writes C with only the parentheses precedence needs.
|
|
SEX_CFLAGS = -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses -Wno-shift-op-parentheses
|
|
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)
|
|
|
|
# Statement-level #line directives can land inside a ?: and break the
|
|
# C (see Sex-field-notes.org), so they are kept to toplevel forms.
|
|
$(B)/%.o: src/%.sex $(SEX_SRC) | $(B)
|
|
$(SEXC) --line-directives=toplevel $< -c -o $@ -- $(CFLAGS) $(SEX_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)/stb.o: src/stb.c third_party/stb/stb_image_write.h | $(B)
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
|
|
|
|
VSMV_OBJ = vsmv cs pb json maps save img dump lcg noise shape worldgen fastnoise rivers terra strata settings verify cJSON stb
|
|
|
|
$(B)/vsmv: $(VSMV_OBJ:%=$(B)/%.o)
|
|
$(CC) $^ -o $@ -lsqlite3
|
|
|
|
VIEWER_OBJ = viewer tiles search hover settings worldgen fastnoise rivers terra strata shape noise lcg maps save pb json cs nk cJSON stb
|
|
|
|
$(B)/vs-map-viewer: $(VIEWER_OBJ:%=$(B)/%.o)
|
|
$(CC) $^ -o $@ $(SDL_LIBS) -lsqlite3
|
|
|
|
$(B):
|
|
mkdir -p $@
|
|
|
|
clean:
|
|
rm -rf $(B)
|
|
|
|
.PHONY: all clean
|