Skip to content

My utility belt `Makefile` (and my memory belt in docs)

License

Notifications You must be signed in to change notification settings

ysoftwareab/core.inc.mk

Repository files navigation

core.inc.mk

I make (pun) a lot of things, and I want to keep them DRY.

The docs folder has some tips and tricks as well.

Usage

I would have this repository as a submodule e.g. as a core.inc.mk folder, and then fetch the submodule, if not already there, and reference it at the top of the real Makefile, just after setting the TOP (root path for the current project):

ifeq (,$(wildcard core.inc.mk/Makefile))
INSTALL_CORE_INC_MK := $(shell git submodule update --init --recursive core.inc.mk)
ifneq (,$(filter undefine,$(.FEATURES)))
undefine INSTALL_CORE_INC_MK
endif
endif

TOP := $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST))))
include core.inc.mk/Makefile

Similarly, if I just want bits and pieces of this:

ifeq (,$(wildcard core.inc.mk/Makefile))
INSTALL_CORE_INC_MK := $(shell git submodule update --init --recursive core.inc.mk)
ifneq (,$(filter undefine,$(.FEATURES)))
undefine INSTALL_CORE_INC_MK
endif
endif

include core.inc.mk/core.inc.mk
include core.inc.mk/target.help.inc.mk

Ref

License

Unlicense

Releases

No releases published

Packages

No packages published