File: Makefile

package info (click to toggle)
cflow 2.0-12.1
  • links: PTS
  • area: main
  • in suites: hamm, potato, slink
  • size: 128 kB
  • ctags: 163
  • sloc: ansic: 1,117; sh: 235; makefile: 102
file content (113 lines) | stat: -rw-r--r-- 2,270 bytes parent folder | download | duplicates (3)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# 
# $Id: Makefile,v 1.7 1995/03/06 14:00:00 leisner Exp leisner $
ifeq "$(origin CC)" "default"
CC=gcc
endif

INSTALL= install -s


# 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
endif

# dirs plus pathnames for prcc & prcg
PREFIX=$(DESTDIR)
BINDIR=$(PREFIX)/usr/bin
LIBDIR=$(PREFIX)/usr/lib/cflow
PRCC_LOC=$(PREFIX)/usr/lib/cflow/prcc
PRCG_LOC=$(PREFIX)/usr/lib/cflow/prcg

PROGS=prcc prcg
# I've seen very long names, and it broke badly with them...

DEFS=-DNAME_MAX=50

# Set if you use Gray Watson dmalloc library
# MALLOC_DEBUG=true
ifdef MALLOC_DEBUG
LOADLIBES=-L$(HOME)/lib -ldmalloc
endif

DEBUG=-g
OPT=-O
CFLAGS=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
	$(DEBUG) $(OPT) $(DEFS)


SRCS=   cflow.sh prcc.c prcg.c
PROGS=	prcc prcg


all: $(PROGS)  cflow

$(PROGS):	%:	%.o


PROTOTYPES= prcc.prototypes.h prcg.prototypes.h



.PHONY:  $(PROTOTYPES)
prototypes: 	$(PROTOTYPES)


install:	
	$(INSTALL)  cflow  $(PROGS)     $(BINDIR)
	$(INSTALL)  $(PROGS)     $(LIBDIR)


cflow:	cflow.sh
	sed -e "s;@CFLOW_SHELL@;$(CFLOW_SHELL);g" \
	    -e "s;@PRCC@;$(PRCC_LOC);" \
	    -e "s;@PRCG@;$(PRCG_LOC);" $< >$@
	chmod +x $@


test:	cflow
	./cflow -X 'errno.h stdlib.h' prcc.c >test.prcc
	./cflow -X 'errno.h stdlib.h' -i prcc.c >test.i.prcc
	diff examples/prcc.cflow test.prcc
	diff examples/prcc.i.cflow test.i.prcc
	# if we got this far, remove examples
	$(RM) test.i.prcc test.prcc

$(PROTOTYPES):	%.prototypes.h:	%.c
	cproto -s $^ >$@

clean::
	$(RM) cflow $(PROGS) *.o test.prcc test.i.prcc


DISTFILES= cflow.lsm $(PROTOTYPES)  TODO  examples cflow.txt cflow.1 $(SRCS) INSTALL  README Makefile

tar:	cflow.txt examples
	tar -czf cflow.tar.gz $(DISTFILES) 
	@rm cflow.txt


shar:	cflow.txt examples 
	shar -T $(DISTFILES)  >cflow.shar
	@rm cflow.txt

.PHONY: examples
examples:
	-mkdir examples
	cflow -X 'errno.h stdlib.h' prcc.c >examples/prcc.cflow
	cflow -X 'errno.h stdlib.h' -i prcc.c >examples/prcc.i.cflow

	
rcsdiff:
	rcsdiff cflow.1 cflow.sh prcc.c prcg.c Makefile


cflow.txt:	cflow.1
	groff -Tascii -mandoc $< >$@

dos-cflow:
	$(MAKE) CFLOW_SHELL=/marty/bin/shdos16 PREFIX=/dos/marty  install-cflow
zip: