BSD Make and GNU Make compatible makefile

I have BSDmakefile and GNUmakefile which are pretty much identical except for dependency management.

GNUmake file:

ifneq ($(MAKECMDGOALS), "clean")
-include $(dependencies)
endif

BSDmake File:

.for i in $(dependencies)
.sinclude "${i}"
.endfor

Is there a way to do this so that I can determine if I am running gmake or bsdmake and then execute the appropriate include statements based on this? I remember someone taking advantage of the fad in both makefile processors so that they could achieve a similar effect.

Alternatively, if there is a better approach than this, I would like to know! (switching to SCons or CMake does not work!)

Thank!

+5
source share
1 answer

, GNU, GNUmakefile, BSD BSDmakefile Makefile.common . Makefile.common . Downside, 3 make 2. , 1.

+9

All Articles