diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-04-03 17:51:17 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-04-03 17:51:17 +0200 |
commit | e81e89e9c49867cb9c3baf8dcb99bbb8ca856f41 (patch) | |
tree | 058c8dbee1e6cb351a3f9c0ca6dfa642ab96d7bf /Makefile | |
parent | m (diff) | |
download | exec-as-e81e89e9c49867cb9c3baf8dcb99bbb8ca856f41.tar.gz exec-as-e81e89e9c49867cb9c3baf8dcb99bbb8ca856f41.tar.bz2 exec-as-e81e89e9c49867cb9c3baf8dcb99bbb8ca856f41.tar.xz |
add install and uninstall rules1
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 41 |
1 files changed, 40 insertions, 1 deletions
@@ -43,10 +43,17 @@ WARN = -Wall -Wextra -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include STD = c99 + # Build rules +.PHONY: default +default: command + .PHONY: all -all: bin/exec-as +all: command + +.PHONY: command +command: bin/exec-as bin/exec-as: obj/exec-as.o @@ -58,6 +65,38 @@ obj/%.o: src/%.c $(CC) -std=$(STD) $(WARN) $(OPTIMISE) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + +# Install rules + +.PHONY: install +install: install-base + +.PHONY: install-base +install-base: install-command install-license + +.PHONY: install-command +install-command: bin/exec-as + install -dm755 -- "$(DESTDIR)$(BINDIR)" + install -m755 bin/exec-as -- "$(DESTDIR)$(BINDIR)/$(COMMAND)" + +.PHONY: install-license +install-license: COPYING LICENSE + install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + install -m644 $^ -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + + + +# Uninstall rules + +.PHONY: uninstall +uninstall: + -rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)" + -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING" + -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE" + -rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + + + # Clean rules .PHONY: clean |