Skip to content

Commit 350a98f

Browse files
committed
Add support for including external makefiles
1 parent 348dcea commit 350a98f

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@
88
/out
99
/.cache
1010
compile_commands.json
11+
12+
/external/*
13+
!/external/external.mk
14+
!/external/README.md

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -439,3 +439,8 @@ endif
439439

440440
.PHONY: run-ack
441441
run-ack: run
442+
443+
EXTERNAL_DIR := $(ROOT_DIR)/external
444+
ifneq (,$(wildcard $(EXTERNAL_DIR)/external.mk))
445+
include $(EXTERNAL_DIR)/external.mk
446+
endif

external/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
All files called `rules.mk` contained within subfolders of this directory will
2+
be sourced at the end of the main `Makefile`. You can use this to add your own
3+
`make` targets. `rules.mk` will have access to all of the variables defined in
4+
the main `Makefile`.

external/external.mk

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include $(wildcard $(EXTERNAL_DIR)/*/rules.mk)

0 commit comments

Comments
 (0)