Browse Source

Makefile: Add install and uninstall targets.

Georgi Chorbadzhiyski 12 years ago
parent
commit
20c2a43ccf
2 changed files with 19 additions and 1 deletions
  1. 19
    0
      Makefile
  2. 0
    1
      TODO

+ 19
- 0
Makefile View File

@@ -13,6 +13,11 @@ endif
13 13
 RM = /bin/rm -f
14 14
 Q = @
15 15
 
16
+PREFIX ?= /usr/local
17
+
18
+INSTALL = tsdecrypt
19
+INSTALL_BIN = $(subst //,/,$(DESTDIR)/$(PREFIX)/bin)
20
+
16 21
 FUNCS_DIR = libfuncs
17 22
 FUNCS_LIB = $(FUNCS_DIR)/libfuncs.a
18 23
 
@@ -25,6 +30,9 @@ tsdecrypt_LIBS = -lcrypto -ldvbcsa -lpthread
25 30
 CLEAN_OBJS = tsdecrypt $(tsdecrypt_OBJS) *~
26 31
 
27 32
 PROGS = tsdecrypt
33
+
34
+.PHONY: distclean clean install uninstall
35
+
28 36
 all: $(PROGS)
29 37
 
30 38
 $(FUNCS_LIB):
@@ -54,3 +62,14 @@ clean:
54 62
 distclean: clean
55 63
 	$(Q)$(MAKE) -s -C $(TS_DIR) clean
56 64
 	$(Q)$(MAKE) -s -C $(FUNCS_DIR) clean
65
+
66
+install: all strip
67
+	@install -d "$(INSTALL_BIN)"
68
+	@echo "INSTALL $(INSTALL) -> $(INSTALL_BIN)"
69
+	$(Q)install $(INSTALL) "$(INSTALL_BIN)"
70
+
71
+uninstall:
72
+	@-for FILE in $(INSTALL); do \
73
+		echo "RM       $(INSTALL_BIN)/$$FILE"; \
74
+		rm "$(INSTALL_BIN)/$$FILE"; \
75
+	done

+ 0
- 1
TODO View File

@@ -1,5 +1,4 @@
1 1
 - Add long options using getopt_long.
2
-- Add make install/uninstall.
3 2
 - Write man page.
4 3
 - Make camd comm code modular in order to add more protocols.
5 4
 - Allow to working with unknown CA's (set CAID as command line parameter).

Loading…
Cancel
Save