Skip to content

Commit

Permalink
Add support for including external makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
gsingh93 committed Apr 5, 2024
1 parent 348dcea commit 350a98f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
/out
/.cache
compile_commands.json

/external/*
!/external/external.mk
!/external/README.md
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -439,3 +439,8 @@ endif

.PHONY: run-ack
run-ack: run

EXTERNAL_DIR := $(ROOT_DIR)/external
ifneq (,$(wildcard $(EXTERNAL_DIR)/external.mk))
include $(EXTERNAL_DIR)/external.mk
endif
4 changes: 4 additions & 0 deletions external/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
All files called `rules.mk` contained within subfolders of this directory will
be sourced at the end of the main `Makefile`. You can use this to add your own
`make` targets. `rules.mk` will have access to all of the variables defined in
the main `Makefile`.
1 change: 1 addition & 0 deletions external/external.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(wildcard $(EXTERNAL_DIR)/*/rules.mk)

0 comments on commit 350a98f

Please sign in to comment.