Make install, uninstall, check work from subdirs
By going up to the above level if needed and having the top-level define a special variable this works.
This commit is contained in:
parent
a1808fd44e
commit
f6598f5469
2 changed files with 14 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -6,6 +6,8 @@ objects=.bash_profile .beetsconfig .conky_box.lua .conkyrc .gitconfig \
|
||||||
.slrnrc .stumpwmrc .tmux.conf .urlview .xbindkeysrc.scm .Xdefaults \
|
.slrnrc .stumpwmrc .tmux.conf .urlview .xbindkeysrc.scm .Xdefaults \
|
||||||
.xinitrc .Xmodmap .xsession .zprofile .zshrc
|
.xinitrc .Xmodmap .xsession .zprofile .zshrc
|
||||||
|
|
||||||
|
export MAKEROOT=y
|
||||||
|
|
||||||
include dotfiles.mk
|
include dotfiles.mk
|
||||||
|
|
||||||
install-.xinitrc: MODE=744
|
install-.xinitrc: MODE=744
|
||||||
|
|
14
dotfiles.mk
14
dotfiles.mk
|
@ -28,9 +28,19 @@ check-modules=$(addprefix check-,$(modules))
|
||||||
$(install-objects) $(uninstall-objects) $(check-objects) \
|
$(install-objects) $(uninstall-objects) $(check-objects) \
|
||||||
$(install-modules) $(uninstall-modules) $(check-modules)
|
$(install-modules) $(uninstall-modules) $(check-modules)
|
||||||
all: $(modules) $(objects)
|
all: $(modules) $(objects)
|
||||||
install: $(install-modules) $(install-objects)
|
|
||||||
|
ifeq ($(MAKEROOT),y)
|
||||||
check: $(check-modules) $(check-objects)
|
check: $(check-modules) $(check-objects)
|
||||||
|
install: $(install-modules) $(install-objects)
|
||||||
uninstall: $(uninstall-modules) $(uninstall-objects)
|
uninstall: $(uninstall-modules) $(uninstall-objects)
|
||||||
|
else
|
||||||
|
check:
|
||||||
|
$(MAKE) -s -C ../ check
|
||||||
|
install:
|
||||||
|
$(MAKE) -C ../ install
|
||||||
|
uninstall:
|
||||||
|
$(MAKE) -C ../ uninstall
|
||||||
|
endif
|
||||||
|
|
||||||
$(modules): %:
|
$(modules): %:
|
||||||
@echo $(MAKEFILES)
|
@echo $(MAKEFILES)
|
||||||
|
@ -56,7 +66,7 @@ $(check-objects): check-%:
|
||||||
echo -e "$(FG_YEL)$* $(FG_RED)older$(CLR_RE)."))
|
echo -e "$(FG_YEL)$* $(FG_RED)older$(CLR_RE)."))
|
||||||
|
|
||||||
$(check-modules): check-%:
|
$(check-modules): check-%:
|
||||||
@$(MAKE) -C $* check
|
@$(MAKE) -s -C $* check
|
||||||
|
|
||||||
$(filter %.elc,$(objects)): %.elc: %.el
|
$(filter %.elc,$(objects)): %.elc: %.el
|
||||||
$(call compile,$^)
|
$(call compile,$^)
|
||||||
|
|
Loading…
Reference in a new issue