more faster
This commit is contained in:
parent
5b8ce3781c
commit
ee414035de
5 changed files with 779 additions and 112 deletions
40
Makefile
40
Makefile
|
|
@ -1,18 +1,32 @@
|
|||
CC ?= cc
|
||||
CFLAGS ?= -std=c11 -O2 -pthread \
|
||||
-Wall -Wextra -Wpedantic -Wshadow -Wformat=2 \
|
||||
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wpointer-arith -Wwrite-strings
|
||||
LDFLAGS ?= -pthread
|
||||
# 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 ?=
|
||||
|
||||
TARGET := pixelflut-render
|
||||
SRC := new.c
|
||||
STD = -std=c11
|
||||
WARN = -Wall -Wextra -Wpedantic -Wshadow -Wformat=2 \
|
||||
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wpointer-arith -Wwrite-strings
|
||||
|
||||
$(TARGET): $(SRC)
|
||||
$(CC) $(CFLAGS) -o $@ $(SRC) $(LDFLAGS)
|
||||
TARGETS = pixelflut-render pixelflut-bench
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
pixelflut-render: new.c pixelflut.h
|
||||
$(CC) $(STD) $(OPT) -pthread $(WARN) $(EXTRA) -o $@ new.c
|
||||
|
||||
pixelflut-bench: bench.c pixelflut.h
|
||||
$(CC) $(STD) $(OPT) -pthread $(WARN) $(EXTRA) -o $@ bench.c
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET)
|
||||
|
||||
.PHONY: clean
|
||||
rm -f $(TARGETS)
|
||||
|
||||
.PHONY: all clean
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue