init cpp repo
This commit is contained in:
commit
88b32bd3f0
8 changed files with 273 additions and 0 deletions
26
Makefile
Normal file
26
Makefile
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
.RECIPEPREFIX = >
|
||||
.DEFAULT_GOAL = build/main.out
|
||||
CXX = clang++
|
||||
CXXFLAGS += -std=c++26 -Wno-experimental-header-units
|
||||
LDFLAGS += -std=c++26
|
||||
SYSTEMHEADER_FLAGS = -Wno-deprecated-builtins -Wno-pragma-system-header-outside-header -Wno-keyword-compat
|
||||
build_module_path = $(let first rest,$1,$(if $(rest),-fmodule-file=$(first) $(call build_module_path,$(rest)),-fmodule-file=$(first)))
|
||||
|
||||
build/main.out: build/main.o
|
||||
> $(CXX) $(LDFLAGS) $^ -o $@
|
||||
|
||||
build/main.o: main.cxx build/print.pcm build/type_traits.pcm
|
||||
> $(CXX) $(CXXFLAGS) -c $(filter-out %.pcm,$^) $(call build_module_path,$(filter %.pcm,$^))
|
||||
> @mv $(patsubst build/%,%,$@) $@
|
||||
|
||||
build/%.pcm:
|
||||
> $(CXX) $(CXXFLAGS) -xc++-system-header --precompile $(patsubst build/%.pcm,%,$@) -o $@ $(SYSTEMHEADER_FLAGS)
|
||||
|
||||
.PHONY: clean run
|
||||
clean:
|
||||
> @-rm -rf ./build/*
|
||||
bear: clean
|
||||
> bear -- $(MAKE)
|
||||
|
||||
run: $(.DEFAULT_GOAL)
|
||||
> @./$(.DEFAULT_GOAL)
|
||||
Loading…
Add table
Add a link
Reference in a new issue