-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (33 loc) · 1.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
pkgname = org.freedesktop.xdg.basedir# $Id$
include xdgbasedir.mk# ~/Library/Makefiles
laxdg ?= $(agentdir)/$(pkgname).plist
agentdir ?= $(prefix)/LaunchAgents# ~/Library/LaunchAgents
envdir ?= $(datarootdir)/MacOSX# ~/Library/Application Support/MacOSX
oldenvdir ?= $(PREFIX)/.MacOSX# ~/.MacOSX
makefilesdir ?= $(prefix)/Makefiles# ~/Library/Makefiles
moderobin ?= 555# ugo=rx
moderodata ?= 444# ugo=r
moderw ?= 755# u=rwx,go=rx
INSTALL_BIN ?= install -bCpSv -m $(modeobin)
INSTALL_DATA ?= install -bCpSv -m $(moderodata)
INSTALL_DIR ?= install -d -v -m $(moderw)
GIT ?= /usr/bin/git
# First target is the default target which will be invoked when typing `make`.
all: print-help #autoinstall
autoinstall: $(GIT)
# clone to $TMPDIR/$pkgname then `make -C $TMPDIR/$pkgname install`...
git-pull: $(GIT)
@$(GIT) pull
install: $(laxdg) install-makefile-xdg
$(laxdg): $(pkgname).plist |$(agentdir)/
launchctl unload $@
$(INSTALL_DATA) $< $@
launchctl load -w $@
install-makefile-xdg: xdgbasedir.mk Darwin.xdg.mk |$(makefilesdir)/
$(INSTALL_DATA) $^ $(makefilesdir)/
$(makefilesdir)/:
$(INSTALL_DIR) $@
$(agentdir)/:
$(INSTALL_DIR) $@
print-help:
@echo "Run 'make install' to install to '~'"