You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
931 B

3 years ago
COMMON_OPT_FLAGS?= -DFROM_MAIN -march=native -flto \
-fgraphite -fopenmp -floop-parallelize-all -ftree-parallelize-loops=4 \
3 years ago
-floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block \
-fno-stack-check -fno-strict-aliasing
C_OPT_FLAGS?=
3 years ago
CXX_OPT_FLAGS?= -felide-constructors -fno-exceptions
3 years ago
LD_OPT_FLAGS?=-O3 -flto
INCLUDE=$(shell pwd)/common/include
3 years ago
COMMON_FLAGS=-pipe -O3 -Wall -Wextra -Wstrict-aliasing -pedantic $(COMMON_OPT_FLAGS)
3 years ago
RUSTFLAGS+=-C target-cpu=native
3 years ago
CFLAGS+=$(COMMON_FLAGS) --std=gnu11 $(C_OPT_FLAGS)
CXXFLAGS+=$(COMMON_FLAGS) --std=gnu++20 $(CXX_OPT_FLAGS)
LDFLAGS+=$(LD_OPT_FLAGS)
3 years ago
3 years ago
DAYS= $(wildcard day*)
3 years ago
ENV= CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" INCLUDE="$(INCLUDE)" RUSTFLAGS="$(RUSTFLAGS)"
3 years ago
3 years ago
.PHONY: all
3 years ago
all: $(addsuffix /part2,$(DAYS))
3 years ago
day%/part2: day%
3 years ago
cd $< && $(ENV) $(MAKE)
3 years ago
clean:
3 years ago
for d in $(DAYS); do pushd $$d && $(MAKE) clean && popd; done
3 years ago