pixelflut-freebsd/Makefile

33 lines
1 KiB
Makefile
Raw Normal View History

2026-07-17 23:01:12 +02:00
# Portable across GNU make (Linux) and BSD make (FreeBSD).
#
# We do NOT read the make flavor's predefined CFLAGS: BSD make's sys.mk sets it
# to "-O2 -pipe", which would fight our OPT setting. Optimization lives in OPT,
# required language/warning flags in STD/WARN, and EXTRA is yours to append.
#
# OPT defaults to an aggressive, build-on-target profile. -march=native tunes
# for THIS machine's CPU, so only build where you run (which is how this repo
# is used). If you cross-build, override it, e.g. make OPT="-O2".
CC ?= cc
OPT ?= -O3 -march=native
EXTRA ?=
2026-07-17 22:25:19 +02:00
2026-07-17 23:01:12 +02:00
STD = -std=c11
WARN = -Wall -Wextra -Wpedantic -Wshadow -Wformat=2 \
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes \
-Wpointer-arith -Wwrite-strings
2026-07-17 22:25:19 +02:00
2026-07-17 23:01:12 +02:00
TARGETS = pixelflut-render pixelflut-bench
2026-07-17 22:25:19 +02:00
2026-07-17 23:01:12 +02:00
all: $(TARGETS)
pixelflut-render: new.c pixelflut.h
$(CC) $(STD) $(OPT) -pthread $(WARN) $(EXTRA) -o $@ new.c
2026-07-17 22:25:19 +02:00
2026-07-17 23:01:12 +02:00
pixelflut-bench: bench.c pixelflut.h
$(CC) $(STD) $(OPT) -pthread $(WARN) $(EXTRA) -o $@ bench.c
clean:
rm -f $(TARGETS)
2026-07-17 22:25:19 +02:00
2026-07-17 23:01:12 +02:00
.PHONY: all clean