aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-03 17:51:17 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-03 17:51:17 +0200
commite81e89e9c49867cb9c3baf8dcb99bbb8ca856f41 (patch)
tree058c8dbee1e6cb351a3f9c0ca6dfa642ab96d7bf /Makefile
parentm (diff)
downloadexec-as-1.tar.gz
exec-as-1.tar.bz2
exec-as-1.tar.xz
add install and uninstall rules1
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--Makefile41
1 files changed, 40 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 893d8f3..50019f8 100644
--- a/Makefile
+++ b/Makefile
@@ -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