fixup ceepeepee support

This commit is contained in:
Alug committed 2025-05-29 21:14:19 +02:00
1 parent 61adbaf47d
commit ca0071496c
1 file changed
+24
+24
View File
@@ -134,6 +134,7 @@ include Makefile.d/util.mk
ifdef PREFIX
CC:=$(PREFIX)-gcc
CXX:=$(PREFIX)-g++
endif
OBJDUMP_OPTS?=--wide --source --line-numbers
@@ -270,15 +271,21 @@ opts+=$(WFLAGS) $(CPPFLAGS) $(CFLAGS)
libs+=$(LDFLAGS) -lstdc++
asflags:=$(ASFLAGS) -x assembler-with-cpp
cxxopts:=$(opts)
cxxopts+=-std=c++17
cxxopts+=$(CXXFLAGS)
cc=$(CC)
cxx=$(CXX)
ifdef DISTCC
cc=distcc $(CC)
cxx=distcc $(CXX)
endif
ifdef CCACHE
cc=ccache $(CC)
cxx=ccache $(CXX)
endif
ifndef SILENT
@@ -293,8 +300,12 @@ SHELL ..... $(SHELL)
CC ........ $(cc)
CXX ....... $(cxx)
CFLAGS .... $(opts)
CXXFLAGS .. $(cxxopts)
LDFLAGS ... $(libs)
endef
@@ -372,6 +383,19 @@ endif
$(.)$(cc) -MM -MF $$@ -MT $(objdir)/$$*.o $(2) $$<
endef
# dependency recipe template (C++)
# 1: source file suffix
# 2: extra flags to gcc
define _recipecxx =
$(depdir)/%.d : %.$(1) | $$$$(@D)/
ifndef WINDOWSHELL
ifdef Echo_name
@printf '%-20.20s\r' $$<
endif
endif
$(.)$(cxx) -MM -MF $$@ -MT $(objdir)/$$*.o $(2) $$<
endef
$(eval $(call _recipe,c))
$(eval $(call _recipe,cpp))
$(eval $(call _recipe,s,$(asflags)))