xref: /original-bsd/local/toolchest/ksh/sh/Makefile (revision e59fb703)
1
2#
3#      Copyright (c) 1984, 1985, 1986 AT&T
4#      All Rights Reserved
5#
6#      THIS IS UNPUBLISHED PROPRIETARY SOURCE
7#      CODE OF AT&T.
8#      The copyright notice above does not
9#      evidence any actual or intended
10#      publication of such source code.
11#
12# @(#)Makefile	1.1
13U370 =
14TESTDIR = .
15INS = /etc/install
16INSDIR =
17CFLAGS = -O
18RJE = $(HOME)/rje
19CPIO = editlib.cpio
20ARK = libedit.a
21# The following two lines are used for one line emacs editor
22EMACS = emacs.o
23DESH = -DESH
24# The following two lines are used for one line vi editor
25VI = vi.o
26DVSH = -DVSH
27# The following line is used for vi mode always raw (u370 requires this)
28# VIRAW = -DRAWONLY
29VIRAW =
30# The following two or three lines are used for BSD Unix
31# DBSD = -BSD
32CC_CMD = $(CC) $(DVSH) $(DESH) $(DBSD) $(VIRAW) $(CFLAGS) -c
33
34LIBFILES = editlib.c \
35edit.h \
36edit.c \
37emacs.c \
38history.h \
39history.c \
40vi.c \
41syscall.s
42
43
44EDITFILES = editlib.o \
45edit.o \
46history.o \
47$(EMACS) \
48$(VI)  \
49$(SYSCALL)
50
51all: $(ARK)
52	if	test "$(DBSD)"; then ranlib $(ARK);fi
53
54
55$(ARK):	clean $(EDITFILES)
56		ar cuv $(TESTDIR)/$(ARK) $(EDITFILES)
57		-/bin/rm $(EDITFILES)
58
59
60emacs.o:	emacs.c
61	set -ex; if test  "$(U370)" = "" ;\
62	then \
63	$(CC_CMD) emacs.c ;\
64	else \
65	$(CC_CMD) -b2,0 emacs.c ;\
66	fi
67
68install:  all
69	  $(INS) -o $(TESTDIR)/$(ARK) $(INSDIR)
70
71clean:
72	  -rm -f $(EDITFILES)
73
74clobber:  clean
75	  -rm -f $(TESTDIR)/$(ARK)
76
77cpio:	$(LIBFILES) Makefile makelib
78	ls $(LIBFILES) Makefile makelib | cpio -ocBv > $(RJE)/$(CPIO)
79
80tar:	$(LIBFILES) Makefile makelib
81	tar -cvpf $(RJE)/$(TAR) $(LIBFILES) Makefile
82
83########
84#
85#	All dependencies and rules not explicitly stated
86#	(including header and nested header dependencies)
87#
88########
89
90
91edit.o:	edit.c
92edit.o:	edit.h
93edit.o:	history.h
94	$(CC_CMD) edit.c
95
96editlib.o:	edit.h
97editlib.o:	editlib.c
98	$(CC_CMD) editlib.c
99
100emacs.o:	edit.h
101emacs.o:	history.h
102
103history.o:	history.c
104history.o:	history.h
105	$(CC_CMD) history.c
106
107vi.o:	edit.h
108vi.o:	history.h
109vi.o:	vi.c
110	$(CC_CMD) vi.c
111
112syscall.o:	syscall.s
113