mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
Rename CFLAGS and friends to follow the conventions of the implicit rules defined by GNU Make: - $(CPPFLAGS) is passed to both C++ and C compiler - $(CXXFLAGS) is passed to C++ compiler only - $(CFLAGS) is passed to C compiler only - C++ compiler is in $(CXX) Signed-off-by: Jan Lindemann <jan@janware.com>
44 lines
1,012 B
Makefile
44 lines
1,012 B
Makefile
# variables
|
|
DEPEND_CFLAGS += -D__MAKEDEPEND__
|
|
DEPEND_CXXFLAGS += -D__MAKEDEPEND__
|
|
DEPEND_MK += $(addprefix .,$(addsuffix .dep.mk, $(OBJ)))
|
|
|
|
ifeq ($(DEPEND_MK_INCLUDED),)
|
|
|
|
all:
|
|
clean: depclean
|
|
|
|
# convenience targets
|
|
dep: $(DEPEND_MK)
|
|
depclean:
|
|
$(RM) -f .*.dep.mk
|
|
|
|
$(DEPEND_MK): $(PREREQ_DONE)
|
|
|
|
ifneq ($(DEPEND_MK),)
|
|
ifeq ($(MAKECMDGOALS),)
|
|
-include $(DEPEND_MK)
|
|
endif
|
|
ifneq ($(filter all,$(MAKECMDGOALS)),)
|
|
-include $(DEPEND_MK)
|
|
endif
|
|
endif
|
|
|
|
%.o: .%.o.dep.mk
|
|
|
|
.%.o.dep.mk: %.cpp $(BUILD_HDR)
|
|
$(CC) -M $(BUILD_CXXFLAGS) $(BUILD_CPPFLAGS) $(DEPEND_CXXFLAGS) $< -o $@
|
|
|
|
.%.o.dep.mk: %.cc $(BUILD_HDR)
|
|
$(CC) -M $(BUILD_CXXFLAGS) $(BUILD_CPPFLAGS) $(DEPEND_CXXFLAGS) $< -o $@
|
|
|
|
.%.o.dep.mk: %.c $(BUILD_HDR)
|
|
$(CC) -M $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(DEPEND_CXXFLAGS) $< -o $@
|
|
|
|
show-vars: show-vars-depend-mk
|
|
show-vars-depend-mk:
|
|
@echo DEPEND_MK = $(DEPEND_MK)
|
|
@echo BUILD_HDR = $(BUILD_HDR)
|
|
|
|
endif # DEPEND_MK_INCLUDED
|
|
DEPEND_MK_INCLUDED := true
|