diff options
| author | 2013-02-15 00:11:23 +0100 | |
|---|---|---|
| committer | 2013-02-15 00:11:23 +0100 | |
| commit | f6598f546995b025349702b0572d0308e45e78a4 (patch) | |
| tree | 6c78feedcf2d39024c475620e2a0c8f01ceaf8ab | |
| parent | a1808fd44e44160545d120c3eafcf790320ce003 (diff) | |
| download | dotfiles-f6598f546995b025349702b0572d0308e45e78a4.tar.gz dotfiles-f6598f546995b025349702b0572d0308e45e78a4.zip | |
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.
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | dotfiles.mk | 14 |
2 files changed, 14 insertions, 2 deletions
@@ -6,6 +6,8 @@ objects=.bash_profile .beetsconfig .conky_box.lua .conkyrc .gitconfig \ .slrnrc .stumpwmrc .tmux.conf .urlview .xbindkeysrc.scm .Xdefaults \ .xinitrc .Xmodmap .xsession .zprofile .zshrc +export MAKEROOT=y + include dotfiles.mk install-.xinitrc: MODE=744 diff --git a/dotfiles.mk b/dotfiles.mk index 77afcee..6018dd2 100644 --- a/dotfiles.mk +++ b/dotfiles.mk @@ -28,9 +28,19 @@ check-modules=$(addprefix check-,$(modules)) $(install-objects) $(uninstall-objects) $(check-objects) \ $(install-modules) $(uninstall-modules) $(check-modules) all: $(modules) $(objects) -install: $(install-modules) $(install-objects) + +ifeq ($(MAKEROOT),y) check: $(check-modules) $(check-objects) +install: $(install-modules) $(install-objects) uninstall: $(uninstall-modules) $(uninstall-objects) +else +check: + $(MAKE) -s -C ../ check +install: + $(MAKE) -C ../ install +uninstall: + $(MAKE) -C ../ uninstall +endif $(modules): %: @echo $(MAKEFILES) @@ -56,7 +66,7 @@ $(check-objects): check-%: echo -e "$(FG_YEL)$* $(FG_RED)older$(CLR_RE).")) $(check-modules): check-%: - @$(MAKE) -C $* check + @$(MAKE) -s -C $* check $(filter %.elc,$(objects)): %.elc: %.el $(call compile,$^) |
