File: makefile

package info (click to toggle)
gkermit 1.0-11
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 492 kB
  • sloc: ansic: 7,960; makefile: 188
file content (139 lines) | stat: -rw-r--r-- 3,344 bytes parent folder | download | duplicates (5)
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# makefile for gkermit - works with make or gmake.
#
# Author:
#   Frank da Cruz
#   The Kermit Project, Columbia University
#   http://www.columbia.edu/kermit/
#   kermit@columbia.edu
#   December 1999
#
# Main build targets:
#   posix:     Build for any POSIX-based platform (default).
#   sysv:      Build for any AT&T UNIX System V based platform.
#   bsd:       Build for any UNIX V7 or 4.3 (or earlier) BSD based platform.
#
# Special build targets:
#   sysvx      Like sysv but uses getchar()/putchar().
#   stty       Uses system("stty blah") instead of API calls.
#   bsd211     For 2.11BSD on the PDP-11 - no nested makes.
#
# Other targets:
#   clean:     Remove object files
#   install:   Install gkermit
#   uninstall: Uninstall gkermit
#
# Default compiler is cc.  To force gcc use:
#   make "CC=gcc" [ <target> ]
#
# See README and COPYING for further information.

# Sample installation values - change or override as needed.
prefix = /usr/local

BINDIR = ${prefix}/bin
MANDIR = ${prefix}/share/man/man1
TEXTDIR = ${prefix}/share/doc/gkermit
INFODIR = ${prefix}/share/info
MANEXT = 1

# Default compiler and flags

CC=cc
CFLAGS= -Wall -DPOSIX -O $(KFLAGS)

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif

# Object files

OBJECTS= gproto.o gkermit.o gunixio.o gcmdline.o

# Targets and dependencies

all:		gwart gkermit

gwart.o:	gwart.c
		$(CC) $(CFLAGS) -c gwart.c

gwart:		gwart.o
		$(CC) -o gwart gwart.o

.c.o:
		$(CC) $(CFLAGS) -c $<

gproto.c:	gproto.w gkermit.h
		./gwart gproto.w gproto.c

gkermit.o:	gkermit.c gkermit.h

gunixio.o:	gunixio.c gkermit.h

gcmdline.o:	gcmdline.c gkermit.h

gkermit:	gproto.o gkermit.o gunixio.o gcmdline.o
		$(CC) -o gkermit $(OBJECTS)

bsd:		gwart
		$(MAKE) "CC=$(CC)" "CFLAGS=-DBSD -O $(KFLAGS)" gkermit

sysv:		gwart
		$(MAKE) "CC=$(CC)" "CFLAGS=-DSYSV -O $(KFLAGS)" gkermit

posix:		gwart
		$(MAKE) "CC=$(CC)" "CFLAGS=-DPOSIX -O $(KFLAGS)" gkermit

sysvx:		gwart
		$(MAKE) "CC=$(CC)" \
		"CFLAGS=-DSYSV -DUSE_GETCHAR -O $(KFLAGS)" gkermit

stty:		gwart
		$(MAKE) "CC=$(CC)" "CFLAGS=$(KFLAGS)" gkermit

bsd211:		gwart
		./gwart gproto.w gproto.c
		cc -DBSD $(KFLAGS) -c gkermit.c
		cc -DBSD $(KFLAGS) -c gproto.c
		cc -DBSD $(KFLAGS) -c gcmdline.c
		cc -DBSD $(KFLAGS) -c gunixio.c
		cc -o gkermit $(OBJECTS)

clean:
		rm -f $(OBJECTS) gproto.o gwart.o gwart gkermit

install:
		@if test -f ./gkermit; then \
		    echo "Installing gkermit..." ; \
		else \
		    echo "Please build the gkermit binary first." ; \
		    exit ; \
		fi
		@echo Copying gkermit to $(BINDIR)...
		@cp gkermit $(BINDIR)/gkermit
		@chmod 755 $(BINDIR)/gkermit
		@ls -lg $(BINDIR)/gkermit
		@if test -d $(TEXTDIR); then \
		    echo "$(TEXTDIR) exists..." ; \
		else \
		    echo "Creating $(TEXTDIR)/..." ; \
		    mkdir $(TEXTDIR) ; \
		    chmod 755 $(TEXTDIR) ; \
		fi
		@echo Copying README to $(TEXTDIR)/gkermit.txt...
		@cp README $(TEXTDIR)/gkermit.txt
		@chmod 644 $(TEXTDIR)/gkermit.txt
		@ls -lg $(TEXTDIR)/gkermit.txt
		@echo Installing man page in $(MANDIR)/gkermit.$(MANEXT)...
		@cp gkermit.nr $(MANDIR)/gkermit.$(MANEXT)
		@chmod 644 $(MANDIR)/gkermit.$(MANEXT)
		@ls -lg $(MANDIR)/gkermit.$(MANEXT)

uninstall:
		@echo Uninstalling gkermit...
		rm -f $(BINDIR)/gkermit \
		$(TEXTDIR)/gkermit.txt \
		$(MANDIR)gkermit.$(MANEXT)

.PHONY:		clean install uninstall

# (end)