summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile73
-rw-r--r--Makefile.laptop53
-rw-r--r--Makefile.osx10
-rw-r--r--Makefile.server9
5 files changed, 89 insertions, 57 deletions
diff --git a/.gitignore b/.gitignore
index 12ca5c1..b6a5fda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,4 @@ supervise/
/weechat/weechat_fifo_*
/weechat/weechat.log
/wunderground
+/.conf-type
diff --git a/Makefile b/Makefile
index 5aec199..9737cba 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,20 @@
INTO := $(HOME)
+TYPE := $(file <.conf-type)
+
+all : build
+
+include Makefile.$(TYPE)
INSTALL := \
+ $(INSTALL) \
.agignore \
.bash_logout \
.bash_profile \
.bashrc \
- .config/alacritty/alacritty.yml \
- .config/touchegg/touchegg.conf \
.crawlrc \
.gdbinit \
.gitconfig \
.gitignore \
- .i3status.conf \
.inputrc \
.ledgerrc \
.less \
@@ -20,10 +23,7 @@ INSTALL := \
.msmtprc \
.muttrc \
.nethackrc \
- .notmuch-config \
- .offlineimaprc \
.perlcriticrc \
- .procmailrc \
.profile \
.proverc \
.replyrc \
@@ -31,29 +31,16 @@ INSTALL := \
.tigrc \
.tmux.conf \
.vimrc \
- .wunderground \
- .xbindkeysrc \
- .Xdefaults \
- .xinitrc \
- .xprofile \
- .Xmodmap \
.zlogout \
.zshcomplete \
.zshinput \
.zshrc \
.abook \
.bin \
- .config/karabiner \
.dzil \
.fortune \
.gnupg \
- .hammerspoon \
- .i3 \
- .mpdscribble \
.ncmpcpp \
- .offlineimap \
- .procmail \
- .services \
.sh \
.ssh \
.terminfo \
@@ -63,29 +50,22 @@ INSTALL := \
.zsh
EMPTYDIRS := \
- $(patsubst services/available/%,.log/%,$(wildcard services/available/*)) \
- Maildir \
+ $(EMPTYDIRS) \
.cache/mutt/headers \
.cache/mutt/bodies \
- .cache/mpd \
.cache/vim/hist \
.cache/vim/undo \
- .config/mpd/playlists
INSTALLED := \
- $(patsubst %,$(INTO)/%,$(EMPTYDIRS) $(INSTALL)) \
- /var/spool/cron/$(USER) \
- $(INTO)/Maildir/.notmuch
+ $(INSTALLED) \
+ $(patsubst %,$(INTO)/%,$(EMPTYDIRS) $(INSTALL))
BUILD := \
- $(patsubst services/available/%,services/enabled/%,$(wildcard services/available/*)) \
+ $(BUILD) \
$(addsuffix .dat,$(filter-out %.dat,$(wildcard fortune/*))) \
$(addsuffix tags,$(wildcard vim/pack/*/start/*/doc/)) \
vim/spell/en.utf-8.add.spl \
- less \
- wunderground \
- mpdscribble/mpdscribble.conf \
- bin/local/timettyrec
+ less
ECHO = @echo
LN = @ln -sf
@@ -94,21 +74,18 @@ RM = @rm -f
# named targets
-all : submodules build
+build : submodules $(BUILD)
submodules :
@git submodule update --init --recursive
-build : $(BUILD)
-
-install : all $(INSTALLED)
+install :: all $(INSTALLED)
@chmod 600 msmtprc
@chmod 700 gnupg
$(ECHO) Installed into $(INTO)
-clean :
+clean ::
$(ECHO) Cleaning from $(INTO)
- @crontab -r
$(RM) $(BUILD) $(INSTALLED)
update :
@@ -120,7 +97,7 @@ versions :
updates :
@git submodule foreach -q 'if [ $$path == "vim/pack/filetype/start/perl" ]; then if [ $$(git rev-parse dev) != $$sha1 ]; then git lg dev...$$sha1; fi; else if [ $$(git rev-parse master) != $$sha1 ]; then git lg master...$$sha1; fi; fi'
-.PHONY: all submodules build install clean update versions updates
+.PHONY: submodules build install clean update versions updates
# installation targets
@@ -129,23 +106,11 @@ $(patsubst %,$(INTO)/%,$(EMPTYDIRS)) :
$(patsubst %,$(INTO)/%,$(INSTALL)) : $(INTO)/.% : %
@[ ! -e $@ ] || [ -h $@ ] || mv -f $@ $@.bak
- $(MKDIR) $(notdir $@)
- $(LN) $(PWD)/$< $@
-
-/var/spool/cron/$(USER) : crontab
- @crontab $<
-
-$(INTO)/Maildir/.notmuch: notmuch
- @[ ! -e $@ ] || [ -h $@ ] || mv -f $@ $@.bak
- $(MKDIR) $(INTO)/Maildir
+ $(MKDIR) $(dir $@)
$(LN) $(PWD)/$< $@
# build targets
-services/enabled/% : services/available/%
- $(MKDIR) services/enabled
- $(LN) ../available/$(notdir $<) $@
-
fortune/%.dat : fortune/%
$(ECHO) "Compiling $@"
@strfile -s $(basename $@)
@@ -158,9 +123,3 @@ fortune/%.dat : fortune/%
less : lesskey
lesskey -o $@ $<
-
-wunderground :
- [ -e ~/.password-store ] && pass show websites/wunderground.com/wunderground@tozt.net > $@ || touch $@
-
-mpdscribble/mpdscribble.conf : mpdscribble/mpdscribble.conf.tmpl
- [ -e ~/.password-store ] && perl -E'while (<STDIN>) { if (/^password =/) { say "password = $$ARGV[0]" } else { print } }' "$$(pass show websites/last.fm/doyster)" < $< > $@ || touch $@
diff --git a/Makefile.laptop b/Makefile.laptop
new file mode 100644
index 0000000..adaa397
--- /dev/null
+++ b/Makefile.laptop
@@ -0,0 +1,53 @@
+INSTALL := \
+ .config/alacritty/alacritty.yml \
+ .config/touchegg/touchegg.conf \
+ .i3status.conf \
+ .notmuch-config \
+ .offlineimaprc \
+ .wunderground \
+ .xbindkeysrc \
+ .Xdefaults \
+ .xinitrc \
+ .xprofile \
+ .Xmodmap \
+ .i3 \
+ .mpdscribble \
+ .offlineimap \
+ .services
+
+EMPTYDIRS := \
+ $(patsubst services/available/%,.log/%,$(wildcard services/available/*)) \
+ Maildir \
+ .cache/mpd \
+ .config/mpd/playlists
+
+INSTALLED := \
+ /var/spool/cron/$(USER) \
+ $(INTO)/Maildir/.notmuch
+
+BUILD := \
+ $(patsubst services/available/%,services/enabled/%,$(wildcard services/available/*)) \
+ wunderground \
+ mpdscribble/mpdscribble.conf \
+ bin/local/timettyrec
+
+clean ::
+ @crontab -r
+
+/var/spool/cron/$(USER) : crontab
+ @crontab $<
+
+$(INTO)/Maildir/.notmuch: notmuch
+ @[ ! -e $@ ] || [ -h $@ ] || mv -f $@ $@.bak
+ $(MKDIR) $(INTO)/Maildir
+ $(LN) $(PWD)/$< $@
+
+services/enabled/% : services/available/%
+ $(MKDIR) services/enabled
+ $(LN) ../available/$(notdir $<) $@
+
+wunderground :
+ pass show websites/wunderground.com/wunderground@tozt.net > $@
+
+mpdscribble/mpdscribble.conf : mpdscribble/mpdscribble.conf.tmpl
+ perl -E'while (<STDIN>) { if (/^password =/) { say "password = $$ARGV[0]" } else { print } }' "$$(pass show websites/last.fm/doyster)" < $< > $@
diff --git a/Makefile.osx b/Makefile.osx
new file mode 100644
index 0000000..5e29806
--- /dev/null
+++ b/Makefile.osx
@@ -0,0 +1,10 @@
+INSTALL := \
+ .config/alacritty/alacritty.yml
+ .config/karabiner \
+ .hammerspoon
+
+EMPTYDIRS := \
+
+INSTALLED := \
+
+BUILD := \
diff --git a/Makefile.server b/Makefile.server
new file mode 100644
index 0000000..9c48f35
--- /dev/null
+++ b/Makefile.server
@@ -0,0 +1,9 @@
+INSTALL := \
+ .procmailrc \
+ .procmail
+
+EMPTYDIRS := \
+
+INSTALLED := \
+
+BUILD := \