summaryrefslogtreecommitdiff
path: root/devel/cflow/files/patch-Makefile
blob: 9d605dfe3a15cd6b3770af995b08e034dc89bedd (plain) (blame)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--- Makefile.orig	1995-03-06 22:00:20.000000000 +0800
+++ Makefile	2014-05-24 22:09:47.087270512 +0800
@@ -5,19 +5,20 @@ CC=gcc
 endif
 
 # use cp backup option if you have gnu cp
-CP=cp
-CP=cp -b
+#CP=cp
+#CP=cp -b
+INSTALL_CMD=	install -c -o bin -g bin
 
 # where you want to install
 ifndef PREFIX
-PREFIX=$(HOME)
+PREFIX=/usr/local
 endif
 
 # which shell do we use for the cflow to script?
 # I know it works on bash on unix, it also should work with
 # msh on ms-dog
 ifndef CFLOW_SHELL
-CFLOW_SHELL=/bin/bash
+CFLOW_SHELL=$(PREFIX)/bin/bash
 endif
 
 # actual location of prcc
@@ -39,12 +40,13 @@ ifdef MALLOC_DEBUG
 LOADLIBES=-L$(HOME)/lib -ldmalloc
 endif
 
-DEBUG=-g
-OPT=-O
-CFLAGS=-Wall $(DEBUG) $(OPT) $(DEFS)
+#DEBUG=-g
+#OPT=-O
+CFLAGS+=$(DEBUG) $(OPT) $(DEFS)
 
 # set this to where to install
-BINDIR=$(PREFIX)/bin
+BINDIR=$(DESTDIR)$(PREFIX)/bin
+MANDIR=$(DESTDIR)$(PREFIX)/man/man1
 
 SRCS=cflow.sh prcc.c prcg.c
 
@@ -64,17 +66,23 @@ PROTOTYPES= prcc.prototypes.h prcg.proto
 prototypes: 	$(PROTOTYPES)
 
 
-install:	install-cflow  install-bins
+install:	install-cflow  install-bins install-man
 
 install-bins: $(BINDIR)/prcc $(BINDIR)/prcg
 
 install-cflow:	$(BINDIR)/cflow
 
+install-man:	$(MANDIR)/cflow.1.gz
+
 $(BINDIR)/prcc $(BINDIR)/prcg: $(BINDIR)/%:	%
-	$(CP) $^ $@
+	$(INSTALL_CMD) $^ $@
 
 $(BINDIR)/cflow:	cflow
-	$(CP) $^ $@
+	$(INSTALL_CMD) -m0755 $^ $@
+
+$(MANDIR)/cflow.1.gz:	cflow.1
+	$(INSTALL_CMD) -m 0644 $^ $(MANDIR)
+	gzip -9nf $(MANDIR)/cflow.1
 
 cflow:	cflow.sh
 	sed -e "s;@CFLOW_SHELL@;$(CFLOW_SHELL);g" \