Browse Source

makefile: Add install and uninstall targets.

Georgi Chorbadzhiyski 12 years ago
parent
commit
bf3ef35383
1 changed files with 16 additions and 0 deletions
  1. 16
    0
      Makefile

+ 16
- 0
Makefile View File

@@ -12,6 +12,13 @@ CFLAGS+=	${CFLAGS_WARN}
12 12
 CFLAGS+=	`pkg-config --cflags fuse`
13 13
 LIBS+=		`pkg-config --libs fuse`
14 14
 
15
+PREFIX ?= /usr/local
16
+
17
+INSTALL_PRG = fjfs
18
+INSTALL_PRG_DIR = $(subst //,/,$(DESTDIR)/$(PREFIX)/bin)
19
+
20
+.PHONY: distclean clean install uninstall
21
+
15 22
 all: fjfs
16 23
 
17 24
 fjfs: fjfs.c
@@ -19,3 +26,12 @@ fjfs: fjfs.c
19 26
 
20 27
 clean:
21 28
 	rm -f fjfs
29
+
30
+distclean: clean
31
+
32
+install: all
33
+	install -d "$(INSTALL_PRG_DIR)"
34
+	install $(INSTALL_PRG) "$(INSTALL_PRG_DIR)"
35
+
36
+uninstall:
37
+	rm $(INSTALL_PRG_DIR)/$(INSTALL_PRG)

Loading…
Cancel
Save