[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why is --include-dir option effective only in sub make ?
From: |
Masahiro Yamada |
Subject: |
Why is --include-dir option effective only in sub make ? |
Date: |
Thu, 13 Sep 2018 14:18:32 +0900 |
Hello,
I wonder why --include-dir does not become
effective in the current Makefile.
Here is the test case.
[ Not working sample ]
-------------(Makefile)--------------
MAKEFLAGS += --include-dir=foo
include inc.mk
all:
@echo hello
-------------(Makefile END)------------
$ mkdir foo
$ touch foo/inc.mk
$ make
Makefile:3: inc.mk: No such file or directory
make: *** No rule to make target 'inc.mk'. Stop.
[ Working sample ]
-------------(Makefile)--------------
MAKEFLAGS += --include-dir=foo
ifneq ($(IN_SUBMAKE),1)
all:
@$(MAKE) IN_SUBMAKE=1
else
include inc.mk
all:
@echo hello
endif
-------------(Makefile END)------------
$ mkdir foo
$ touch foo/inc.mk
$ make
make[1]: Entering directory '/home/masahiro/workspace'
hello
make[1]: Leaving directory '/home/masahiro/workspace'
>From the example above, --include-dir is effective
only after diving into sub make.
Is this an intentional behavior?
Is there a way to make it effective in the current make?
--
Best Regards
Masahiro Yamada
- Why is --include-dir option effective only in sub make ?,
Masahiro Yamada <=