chiark / gitweb /
dot/gpg.conf.m4, dot/gpg-agent.conf, Makefile: Adopt GnuPG configuration.
[profile] / Makefile
CommitLineData
67b1a15a
MW
1## -*-makefile-*-
2
807c317e 3all:
5e776d3c
MW
4.PHONY: all
5
6clean::
7.PHONY: clean
8
67b1a15a
MW
9.SECONDEXPANSION: #sorry
10
11###--------------------------------------------------------------------------
12### Utilities.
13
14##
15quote = '$(subst ','\'',$1)'#'
16
17## Suss out how to print stuff.
18print = printf "%s" $(call quote,$1)
19
20## Looking configuration things up.
21mdw-conf = $(shell bin/mdw-conf "$1" "$2")
22
23## Checking symlink targets.
24symlink-ok-p = $(shell \
25 case $$(readlink 2>/dev/null $1) in ($2) echo t ;; esac)
26
27## Silent rules machinery.
28V = 0
67b1a15a
MW
29V_AT = $(V_AT_$V)
30V_AT_0 = @
2e0a8012 31v_print = $(call v_print_$V,$1,$2)
a811ce27
MW
32v_print_0 = \
33 printf " %-8s %s\n" "$1" $(call quote,$(patsubst $(HOME)/%,~/%,$2));
2e0a8012 34v_tag = $(V_AT)$(call v_print_$V,$1,$@)
67b1a15a 35
c940b9dd
MW
36## Making directories.
37%/:; $(call v_tag,MKDIR)mkdir -p $@
38
67b1a15a
MW
39## Hack.
40relax =
41
42###--------------------------------------------------------------------------
43### Configuration.
44
45## Figure out where I am.
3337f511 46HERE := $(shell pwd)
67b1a15a
MW
47
48## Decide on how to fetch things from URLs.
49ifeq ($(shell (curl >/dev/null 2>&1 --version || [ $$? -eq 2 ]) && echo t),t)
50 get-url = curl -fs -o $1 $2
51else
52 get-url = wget -q -O $1 $2
53endif
54
55## Which Emacs should I use?
56EMACS := $(shell \
57 emacs=nil; \
58 for i in emacs24 emacs23 emacs22 emacs21 emacs; do \
3337f511
MW
59 if type >/dev/null 2>&1 $$i; then emacs=$$i; break; fi; \
60 done; \
61 echo $$emacs)
67b1a15a
MW
62
63## Whence to obtain externally hosted stuff.
64REPO = https://ftp.distorted.org.uk/u/mdw/profile
65
66## Additional local configuration.
67-include local.mk
68
69###--------------------------------------------------------------------------
70### Some utility rules.
71
72_force:
73.PHONY: _force
74
75###--------------------------------------------------------------------------
76### Emacs.
77
967148ff
MW
78ifneq ($(EMACS),nil)
79
67b1a15a
MW
80EMACSLIB = $(HOME)/lib/emacs
81
486623cb 82EMACS_VERSION := $(shell $(EMACS) 2>&1 -Q --batch --eval \
b2f6f110
MW
83 '(message "%s %s" emacs-major-version emacs-minor-version)' | \
84 tail -n1)
486623cb
MW
85emacs-version-p = $(shell set -- $(EMACS_VERSION); \
86 if [ $$1 -gt $1 ] || ([ $$1 -eq $1 ] && [ $$2 -ge $2 ]); then \
87 echo t; \
88 fi)
89
6369ae29
MW
90ELISP += make-regexp ew-hols
91ELISP += mdw-gnus-patch
92ELISP += mdw-multiple-cursors
93ELISP += git git-blame vc-git stgit quilt
486623cb
MW
94
95ifeq ($(call emacs-version-p,24,3),t)
6369ae29 96ELISP += bracketed-paste
486623cb 97endif
67b1a15a 98
3e441da6
MW
99ELISP += dot-emacs
100dot-emacs_DEPS = make-regexp
101
67b1a15a 102SCRIPTLINKS += emacsclient-hack movemail-hack sendmail-hack
cef9886f 103SCRIPTLINKS += aspell-hack emerge-hack wakey.sh
67b1a15a 104
3e441da6 105%.elc: %.el $$(foreach e, $$($$*_DEPS), $$(DEP_$$e))
83198952
MW
106 $(call v_tag,EMACS)if ! $(EMACS) >$*.build-log 2>&1 \
107 -L el/ -L $(EMACSLIB) \
67b1a15a 108 --batch --no-site-file \
34b3e368 109 --eval '(kill-emacs (if (byte-compile-file "$<") 0 2))'; then \
83198952
MW
110 cat $*.build-log; exit 2; \
111 fi
67b1a15a 112
6369ae29
MW
113LOCAL_ELISP = $(filter $(notdir $(wildcard el/*.el)), \
114 $(addsuffix .el, $(ELISP)))
115$(foreach e, $(LOCAL_ELISP), \
116 $(eval DEP_$(basename $e) = $(EMACSLIB)/$(e:.el=.elc)))
c940b9dd
MW
117$(addprefix $(EMACSLIB)/, $(LOCAL_ELISP)): $(EMACSLIB)/%: el/% | $(EMACSLIB)/
118 $(call v_tag,SYMINK) \
67b1a15a
MW
119 rm -f $@.new && \
120 ln -s $(HERE)/$< $@.new && \
121 mv $@.new $@
122
123REMOTE_ELISP = $(filter-out $(notdir $(wildcard el/*.el)), \
6369ae29 124 $(addsuffix .el, $(ELISP)))
67b1a15a 125$(foreach e, $(REMOTE_ELISP), \
6369ae29 126 $(eval DEP_$(basename $e) = $(if $(shell \
67b1a15a
MW
127 if $(EMACS) >/dev/null 2>&1 --no-site-file -q --batch \
128 --eval ' \
129 (progn \
130 (kill-emacs (condition-case nil \
131 (progn (load-library "$e") 0) \
132 (error 1))))'; then \
133 echo t; \
134 fi),, $(EMACSLIB)/$(e:.el=.elc))))
c940b9dd
MW
135$(addprefix $(EMACSLIB)/, $(REMOTE_ELISP)): $(EMACSLIB)/%: | $(EMACSLIB)/
136 $(call v_tag,FETCH) \
67b1a15a
MW
137 $(call get-url,$@.new,$(REPO)/$*) && \
138 mv $@.new $@
139
140DOTLINKS += .emacs .emacs-calc .vm .gnus.el .ercrc.el
141
807c317e 142all: $(foreach e, $(ELISP), $(DEP_$e))
6369ae29 143$(foreach e, $(ELISP), $(eval _emacs.$e: $(EMACSLIB)/$e.elc))
67b1a15a 144
967148ff
MW
145endif
146
67b1a15a
MW
147###--------------------------------------------------------------------------
148### Other simpler things.
149
150$(HOME)/.mdw.conf:
151 $(call v_tag,COPY)cp mdw.conf $@.new && mv $@.new $@
152
153## Utility packages.
154PACKAGES += mlib checkpath
155mlib_CHECK = crc-mktab
156checkpath_CHECK = tmpdir
157checkpath_DEPS = mlib
158
159## Packaging machinery.
160SCRIPTLINKS += mdw-build mdw-sbuild mdw-sbuild-server
161SCRIPTLINKS += update-buildable-branch
f0637893
MW
162DOTLINKS += .config/mdw-build.conf
163.config/mdw-build.conf_SRC = mdw-build.conf
67b1a15a
MW
164
165## Shells.
166DOTLINKS += .profile .shell-rc .shell-logout
a3857ab2 167DOTLINKS += .shrc
9ba9bb2f
MW
168DOTLINKS += .zprofile .zshrc .zlogout .zshenv
169DOTLINKS += .bash_profile .bash_completion .bash_logout
170DOTLINKS += .bashrc .inputrc
67b1a15a
MW
171.bash_profile_SRC = bash-profile
172.bash_completion_SRC = bash-completion
9ba9bb2f
MW
173.bash_logout_SRC = shell-logout
174.zlogout_SRC = shell-logout
67b1a15a 175
807c317e
MW
176all: zap-stale-zcompdump
177zap-stale-zcompdump:
72123a3a
MW
178 $(V_AT)if [ $(HOME)/.zcompdump -ot dot/zshrc ]; then \
179 $(call v_print,ZAP,$(HOME)/.zcompdump)rm -f $(HOME)/.zcompdump; \
180 fi
807c317e 181.PHONY: zap-stale-zcompdump
72123a3a 182
a3857ab2
MW
183## The Plan 9 `rc' shell. This needs special hacking, because the Linux port
184## and Plan 9 From User Space have incompatible syntax.
185DOTLINKS += lib/profile
186lib/profile_SRC = rcrc
807c317e 187all: $(HOME)/.rcrc
a3857ab2
MW
188$(HOME)/.rcrc: dot/rcrc
189 $(call v_tag,SED)sed 's/; if not/else/' $< >$@.new && mv $@.new $@
190
67b1a15a
MW
191## Git.
192DOTSUBST += .gitconfig
2e15741e 193SCRIPTLINKS += git-copyright-dates
67b1a15a
MW
194DOTLINKS += .cgrc .tigrc
195.gitconfig_SUBSTS = \
9ca6d190
MW
196 $(call substvar,releasekey,$(call mdw-conf,releasekey,481334C2)) \
197 $(call substvar,email,$(call mdw-conf,email,mdw@distorted.org.uk))
67b1a15a
MW
198$(HOME)/.gitconfig: $(HOME)/.mdw.conf
199
200## PulseAudio.
201DOTLINKS += .pulse/daemon.conf
202DOTSUBST += .pulse/default.pa
203.pulse/daemon.conf_SRC = pulse-daemon.conf
204.pulse/default.pa_SRC = pulse-default.pa.in
205
206## Other editors.
207DOTLINKS += .vimrc .mg .zile
208
209## Mail.
210DOTLINKS += .mailrc .signature .muttrc
211
212## Lisp.
6a8c8070
MW
213DOTLINKS += .cmucl-init.lisp .sbclrc .clisprc.lisp
214DOTLINKS += .eclrc .ccl-init.lisp .abclrc
67b1a15a
MW
215.cmucl-init.lisp_SRC = lisp-init.lisp
216.sbclrc_SRC = lisp-init.lisp
217.clisprc.lisp_SRC = lisp-init.lisp
218.eclrc_SRC = lisp-init.lisp
6a8c8070
MW
219.ccl-init.lisp_SRC = lisp-init.lisp
220.abclrc_SRC = lisp-init.lisp
67b1a15a
MW
221DOTLINKS += .swank.lisp
222
6f4c361e 223## IPython, Jupyter, and related annoyances.
67b1a15a
MW
224DOTLINKS += .ipython/profile_default/ipython_config.py
225DOTLINKS += .ipython/profile_default/startup/50-key-bindings.py
6f4c361e 226DOTLINKS += .jupyter/nbconfig/notebook.json
67b1a15a
MW
227.ipython/profile_default/ipython_config.py_SRC = ipython-config.py
228.ipython/profile_default/startup/50-key-bindings.py_SRC = ipython-key-bindings.py
6f4c361e 229.jupyter/nbconfig/notebook.json_SRC = jupyter-notebook.json
67b1a15a
MW
230
231## Other languages.
232DOTLINKS += .guile
233DOTLINKS += .tclshrc .wishrc
234.tclshrc_SRC = tclshrc
235.wishrc_SRC = tclshrc
236
bc61033e
MW
237## The `nocss' machinery.
238SCRIPTLINKS += nocss
239all: $(HOME)/lib/hacks/nocss/libdvdcss.so.2
c940b9dd 240$(HOME)/lib/hacks/nocss/libdvdcss.so.2: | $$(dir $$@)
bc61033e
MW
241 $(call v_tag,TOUCH)touch $@
242
c940b9dd
MW
243## GnuPG.
244all: $(HOME)/.gnupg/gpg.conf
245$(HOME)/.gnupg/gpg.conf: \
246 dot/gpg.conf.m4 $(wildcard $(HOME)/.gnupg/gpg.local.conf) \
247 $(HOME)/.mdw.conf \
248 | $$(dir $$@)
249 $(call v_tag,M4)cd $(dir $@) && \
250 args= && \
251 key=$$(mdw-conf default-gpg-key nil) && \
252 case $$key in \
253 nil) ;; \
254 *) args=$${args+$$args }-DDEFAULT_KEY=$$key ;; \
255 esac && \
256 cd $(dir $@) && m4 -P $$args $(HERE)/$< >$@.new && \
257 mv $@.new $@
258DOTLINKS += .gnupg/gpg-agent.conf
259.gnupg/gpg-agent.conf_SRC = gpg-agent.conf
260
67b1a15a
MW
261## Random scripts.
262SCRIPTLINKS += mdw-editor mdw-pager
263SCRIPTLINKS += mdw-conf
264SCRIPTLINKS += svnwrap
265SCRIPTLINKS += guest-console
266SCRIPTLINKS += hyperspec
310d0527 267SCRIPTLINKS += bdl
878a38bd 268SCRIPTLINKS += datasyms
8945a62f 269SCRIPTLINKS += fixsub
01a5d0a6 270SCRIPTLINKS += check-debsyms
a98bca79 271SCRIPTLINKS += check-blkdev-size
a10bf242 272SCRIPTLINKS += xremote
d32df53a 273SCRIPTLINKS += disorder-play-on-demand remote-disorder
a10bf242 274SCRIPTLINKS += remote-slideshow
67b1a15a
MW
275
276## Random odds and ends.
3f7369a9 277DOTLINKS += .infokey .sqliterc
67b1a15a
MW
278DOTLINKS += .gdbinit .toprc .aspell.conf
279DOTLINKS += .dircolors .colordiffrc .screenrc .tmux.conf
280DOTLINKS += .cvsrc .indent.pro .ditz-config
da526ba7
MW
281DOTLINKS += .lftp/rc
282.lftp/rc_SRC = lftp-rc
dd794b20
MW
283DOTLINKS += .a2ps/a2psrc
284.a2ps/a2psrc_SRC = a2psrc
67b1a15a
MW
285DOTSUBST += .mykermrc
286SCRIPTLINKS += lesspipe.sh
287
288SCRIPTLINKS += run-with-shell-env
289SCRIPTLINKS += start-ssh-agent start-ssh-pageant
290SCRIPTLINKS += add-ssh-keys
291SCRIPTLINKS += hacks/ssh/ssh
292hacks/ssh/ssh_SRC = hacks/ssh
293
294DOTLINKS += .w3m/config .elinks/elinks.conf
295.w3m/config_SRC = w3m-config
296.elinks/elinks.conf_SRC = elinks.conf
297
298DOTLINKS += .mc/ini .mc/panels.ini
299.mc/ini_SRC = mc-ini
300.mc/panels.ini_SRC = mc-panels.ini
301
e8f132bd 302DOTLINKS += .parallel/config .parallel/sshloginfile
67b1a15a 303.parallel/config_SRC = parallel-config
e8f132bd 304.parallel/sshloginfile_SRC = parallel-hosts
67b1a15a 305
807c317e 306all: $(HOME)/.less
3f7369a9
MW
307$(HOME)/.less: dot/lesskey
308 $(V_AT)rm -f $(HOME)/.lesskey
309 $(call v_tag,LESSKEY)lesskey -o$@ $<
310
67b1a15a
MW
311###--------------------------------------------------------------------------
312### X11 configuration.
313
314ifeq ($X,t)
315
316PACKAGES += xtoys
317xtoys_CHECK = xatom
318xtoys_DEPS = mlib
319
320DOTLINKS += .xinitrc .xsession .xmodmap .vncrc .vncsession
df4bcc77
MW
321DOTLINKS += .config/fontconfig/fonts.conf
322.config/fontconfig/fonts.conf_SRC = fonts.conf
67b1a15a
MW
323DOTLINKS += .stalonetrayrc
324
67b1a15a
MW
325DOTLINKS += .config/gnome-session/sessions/mdw.session
326.config/gnome-session/sessions/mdw.session_SRC = mdw.session
327
328DOTLINKS += .Eterm/themes/Eterm/theme.cfg
329DOTLINKS += .enlightenment/keybindings.cfg
330DOTLINKS += .enlightenment-vnc/keybindings.cfg
331DOTLINKS += .e16/bindings.cfg
332.Eterm/themes/Eterm/theme.cfg_SRC = eterm-theme.cfg
333.enlightenment/keybindings.cfg_SRC = e-keybindings.cfg
334.enlightenment-vnc/keybindings.cfg_SRC = evnc-keybindings.cfg
335.e16/bindings.cfg_SRC = e16-bindings
336
337DOTLINKS += .gtkrc-2.0
338DOTLINKS += .config/gtk-3.0/gtk.css
339DOTLINKS += .config/gtk-3.0/settings.ini
340.config/gtk-3.0/gtk.css_SRC = gtk3.css
341.config/gtk-3.0/settings.ini_SRC = gtk3-settings.ini
342
a9d5edbf
MW
343DOTLINKS += .config/user-dirs.dirs .config/user-dirs.locale
344.config/user-dirs.dirs_SRC = user-dirs.dirs
345.config/user-dirs.locale_SRC = user-dirs.locale
346
67b1a15a
MW
347SCRIPTLINKS += xinitcmd lock-screen xshutdown
348SCRIPTLINKS += un-backslashify-selection
349SCRIPTLINKS += xpra-start-xdummy
5f9b345a 350SCRIPTLINKS += play-rawk
75a2ccd4 351SCRIPTLINKS += x2x-privsep
b3ee0533 352SCRIPTLINKS += xduplic-terminal
56e4c6c0 353SCRIPTLINKS += xzoomscr
67b1a15a
MW
354
355DOTCPP += .Xdefaults
356Xdefaults_DEFS = -DEMACSWD=$(call mdw-conf,emacs-width,77)
57a9b0cd 357$(HOME)/.Xdefaults: $(HOME)/.mdw.conf dot/Xdefaults.pterm
67b1a15a 358
ddc97f65
MW
359ifeq ($(shell case $${DISPLAY-nil} in (:[0-9]*) echo t ;; (*) echo nil ;; esac),t)
360dotfile-hook/.Xdefaults = \
8baf0354 361 $(call v_tag,XRDB)xrdb -load $<
ddc97f65
MW
362endif
363
67b1a15a
MW
364endif
365
53ad55a5
MW
366###--------------------------------------------------------------------------
367### Firefox things.
368
369ifeq ($(FIREFOX),t)
370
53ad55a5
MW
371clean::; rm -rf out/
372
807c317e 373all: out/firefox/smartup-gestures.config
53ad55a5
MW
374out/firefox/smartup-gestures.config: firefox/smartup-gestures.json | out/firefox/
375 $(call v_tag,BLOB)\
376 jq -c . $< | bincode base64 >$@.new && mv $@.new $@
377
807c317e 378all: out/firefox/stylus.json
53ad55a5
MW
379out/firefox/stylus.json: firefox/stylus/ firefox/stylus/*.css | out/firefox/
380 $(call v_tag,IMPLODE)\
381 firefox/implode-stylus firefox/stylus/ >$@.new && \
382 mv $@.new $@
383endif
384
9c72b1b3
MW
385###--------------------------------------------------------------------------
386### General symlinking.
387
388misclink-source = $(HERE)/$(or $($1_SRC), $1)
389
807c317e 390all: $(addprefix $(HOME)/, $(MISCLINKS))
9c72b1b3
MW
391misclink-ok-p = \
392 $(call symlink-ok-p,$(HOME)/$1,$(call misclink-source,$1))
393$(addprefix $(HOME)/, $(subst %,\%,$(MISCLINKS))): $(HOME)/%: \
c940b9dd
MW
394 $$(if $$(call misclink-ok-p,$$*),,_force) | $$(dir $$@)
395 $(call v_tag,SYMLINK) \
9c72b1b3
MW
396 rm -f $@.new && \
397 ln -s $(call misclink-source,$*) $@.new && \
398 mv $@.new $@
399 $(symlink-hook/$*)
400
67b1a15a
MW
401###--------------------------------------------------------------------------
402### Processing dotfiles.
403
404dotfile-source = $(HERE)/dot/$(or $($1_SRC), $(1:.%=%)$2)
405
4937ba2d 406## Easiest: just make symlinks.
67b1a15a
MW
407dotlink-ok-p = \
408 $(call symlink-ok-p,$(HOME)/$1,$(call dotfile-source,$1))
807c317e 409all: $(addprefix $(HOME)/, $(DOTLINKS))
67b1a15a 410$(addprefix $(HOME)/, $(subst %,\%,$(DOTLINKS))): $(HOME)/%: \
c940b9dd
MW
411 $$(if $$(call dotlink-ok-p,$$*),,_force) | $$(dir $$@)
412 $(call v_tag,SYMLINK) \
67b1a15a
MW
413 rm -f $@.new && \
414 ln -s $(call dotfile-source,$*) $@.new && \
415 mv $@.new $@
f6c3a80b 416 $(dotfile-hook/$*)
67b1a15a
MW
417
418## Hack with the C preprocessor.
807c317e 419all: $(addprefix $(HOME)/, $(DOTCPP))
67b1a15a 420$(addprefix $(HOME)/, $(subst %,\%,$(DOTCPP))): $(HOME)/%: \
c940b9dd
MW
421 $$(call dotfile-source,$$*) Makefile | $$(dir $$@)
422 $(call v_tag,CPP) \
67b1a15a
MW
423 rm -f $@.new && \
424 cpp -P -o$@.new $($*_DEFS) $< && \
425 mv $@.new $@
f6c3a80b 426 $(dotfile-hook/$*)
67b1a15a
MW
427
428## Hack by making simple substitutions.
429substvar = -e $(call quote,s\a@$1@\a$2\ag)
430SUBSTS += $(call substvar,home,$(HOME))
431SUBSTS += $(call substvar,profile,$(HERE))
807c317e 432all: $(addprefix $(HOME)/, $(DOTSUBST))
67b1a15a 433$(addprefix $(HOME)/, $(subst %,\%,$(DOTSUBST))): $(HOME)/%: \
c940b9dd
MW
434 $$(call dotfile-source,$$*,.in) Makefile | $$(dir $$@)
435 $(call v_tag,SUBST) \
67b1a15a
MW
436 rm -f $@.new && \
437 sed -e "1i\
438$(relax)### generated by $(HERE)/Makefile; do not edit!" \
439 $(SUBSTS) $($*_SUBSTS) \
440 $(call dotfile-source,$*,.in) >$@.new && \
441 mv $@.new $@
f6c3a80b 442 $(dotfile-hook/$*)
67b1a15a
MW
443
444###--------------------------------------------------------------------------
445### Processing script links.
446
447script-source = $(HERE)/bin/$(or $($1_SRC), $1)
0cd3b798
MW
448
449ifeq ($(prefix-shebang-p),t)
807c317e 450all: $(addprefix $(HOME)/bin/, $(SCRIPTLINKS))
0cd3b798 451$(addprefix $(HOME)/bin/, $(SCRIPTLINKS)): $(HOME)/bin/%: \
c940b9dd
MW
452 $$(call script-source,$$*) Makefile | $$(dir $$@)
453 $(call v_tag,SHEBANG) \
0cd3b798
MW
454 rm -f $@.new && \
455 sed "1s\a\(#! *\)/\a\1$(SHEBANG_PREFIX)/\a" \
456 $(call script-source,$*) >$@.new && \
457 chmod --reference=$(call script-source,$*) $@.new && \
458 mv $@.new $@
459 $(script-hook/$*)
460else
67b1a15a
MW
461scriptlink-ok-p = \
462 $(call symlink-ok-p,$(HOME)/bin/$1,$(call script-source,$1))
807c317e 463all: $(addprefix $(HOME)/bin/, $(SCRIPTLINKS))
67b1a15a 464$(addprefix $(HOME)/bin/, $(SCRIPTLINKS)): $(HOME)/bin/%: \
c940b9dd
MW
465 $$(if $$(call scriptlink-ok-p,$$*),,_force) | $$(dir $$@)
466 $(call v_tag,SYMLINK) \
67b1a15a
MW
467 rm -f $@.new && \
468 ln -s $(call script-source,$*) $@.new && \
469 mv $@.new $@
f6c3a80b 470 $(script-hook/$*)
0cd3b798 471endif
67b1a15a 472
807c317e 473all: $(addprefix $(HOME)/bin/, $(SCRIPTLINKS))
67b1a15a
MW
474
475###--------------------------------------------------------------------------
476### Building packages from source tarballs.
477
478SRCDIR = $(HOME)/src/profile
479
480pkg-builddir = $(SRCDIR)/$1/build
481pkg-stamp = $(call pkg-builddir,$1)/$2-stamp
482
483$(foreach p, $(PACKAGES), $(eval DEP_$p = $(if $(shell \
484 if $($p_CHECK) >/dev/null 2>&1 --version; then echo t; fi),, \
485 $(call pkg-stamp,$p,install))))
486
c940b9dd
MW
487$(PACKAGES:%=$(SRCDIR)/%.tar.gz): $(SRCDIR)/%.tar.gz: | $(SRCDIR)/
488 $(call v_tag,FETCH) \
67b1a15a
MW
489 rm -f $@.new && \
490 $(call get-url,$@.new,$(REPO)/$*.tar.gz) && \
491 mv $@.new $@
492
493$(foreach p, $(PACKAGES), $(call pkg-stamp,$p,unpack)): \
494 $(call pkg-stamp,%,unpack): $(SRCDIR)/%.tar.gz
495 $(call v_tag,EXTRACT)rm -rf $(SRCDIR)/$* && \
496 mkdir $(SRCDIR)/$*.tmp-unpack && \
497 cd $(SRCDIR)/$*.tmp-unpack && \
498 gzip -cd ../$*.tar.gz | tar xf - && \
499 mv * ../$* && \
500 cd .. && \
501 rmdir $*.tmp-unpack && \
502 mkdir $*/build && \
503 touch $*/build/unpack-stamp
504
505$(foreach p, $(PACKAGES), $(call pkg-stamp,$p,configure)): \
506 $(call pkg-stamp,%,configure): \
507 $(call pkg-stamp,%,unpack) \
508 $$(foreach p, $$($$*_DEPS), $$(DEP_$$p))
509 $(call v_tag,CONFIG)cd $(dir $@) && \
510 ../configure --prefix=$(HOME) \
511 PKG_CONFIG_PATH=$(HOME)/lib/pkgconfig \
512 $($*_CONFIG) >>buildlog 2>&1 && \
513 touch configure-stamp
514
515$(foreach p, $(PACKAGES), $(call pkg-stamp,$p,build)): \
516 $(call pkg-stamp,%,build): \
517 $(call pkg-stamp,%,configure)
518 $(call v_tag,BUILD)cd $(dir $@) && \
519 $(MAKE) $($*_MAKEFLAGS) >>buildlog 2>&1 && \
520 touch build-stamp
521
522$(foreach p, $(PACKAGES), $(call pkg-stamp,$p,install)): \
523 $(call pkg-stamp,%,install): \
524 $(call pkg-stamp,%,build)
525 $(call v_tag,INSTALL)cd $(dir $@) && \
526 $(MAKE) $($*_MAKEFLAGS) install >>buildlog 2>&1 && \
527 touch install-stamp
f6c3a80b 528 $(package-hook/$*)
67b1a15a 529
807c317e 530all: $(foreach p, $(PACKAGES), $(DEP_$p))
67b1a15a
MW
531$(foreach p, $(PACKAGES), $(eval _pkg.$p: $(call pkg-stamp,$p,install)))
532
533###----- That's all, folks --------------------------------------------------