xref: /illumos-gate/usr/src/cmd/csh/i386/Makefile (revision d17be682a2c70b4505d43c830bbd2603da11918d)
1# Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
2#
3#	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
4#	  All Rights Reserved
5#
6# Copyright (c) 1980 Regents of the University of California.
7# All rights reserved.  The Berkeley Software License Agreement
8# specifies the terms and conditions for redistribution.
9#
10# Copyright (c) 2018, Joyent, Inc.
11#
12# C Shell with process control; VM/UNIX VAX Makefile
13# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
14#
15
16CSH_PROG =	csh
17PROG =		$(CSH_PROG)
18
19include ../../Makefile.cmd
20
21MBCHAR	= -DMBCHAR	# Define this line to include multibyte input support
22DEFS	=  -DVFORK -DFILEC -DBSD_COMP -DFIVE	# No TELL when MBCHAR
23CPPFLAGS= -I. $(DEFS) $(MBCHAR) $(CPPFLAGS.master)
24CPPFLAGS +=	-I../../sh
25CPPFLAGS += -D_FILE_OFFSET_BITS=64
26LDLIBS += -lcurses
27
28CERRWARN += -_gcc=-Wno-implicit-function-declaration
29CERRWARN += $(CNOWARN_UNINIT)
30CERRWARN += -_gcc=-Wno-parentheses
31CERRWARN += -_gcc=-Wno-implicit-int
32CERRWARN += -_gcc=-Wno-unused-function
33CERRWARN += -_gcc=-Wno-unused-variable
34CERRWARN += -_gcc=-Wno-clobbered
35CERRWARN += -_gcc=-Wno-unused-label
36CERRWARN += -_gcc=-Wno-extra
37
38# "missing type for func"
39SMATCH=off
40
41MAPFILES =	../mapfile-intf $(MAPFILE.NGB)
42LDFLAGS +=	$(MAPFILES:%=-Wl,-M%)
43
44HDDEP = sh.o sh.dir.o sh.dol.o sh.err.o sh.exec.o sh.exp.o sh.file.o \
45	sh.func.o sh.glob.o sh.hist.o sh.init.o sh.lex.o sh.misc.o \
46	sh.parse.o sh.proc.o sh.sem.o sh.set.o sh.time.o
47
48COMMONOBJS=	printf.o sh.char.o sh.dir.o sh.dol.o sh.err.o \
49	sh.exec.o sh.exp.o sh.file.o sh.func.o sh.glob.o sh.hist.o sh.init.o \
50	sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.proc.o sh.sem.o sh.set.o \
51	sh.time.o sh.tchar.o sh.tconst.o sh.o \
52        wait3.o
53
54LOCALOBJS= signal.o
55
56COMMONSRCS=	$(COMMONOBJS:%.o=../%.c)
57
58.KEEP_STATE:
59
60.PARALLEL: $(COMMONOBJS) $(LOCALOBJS)
61
62all: $(PROG)
63
64# build rule for common source above
65%.o:	../%.c
66	$(COMPILE.c) $<
67	$(POST_PROCESS_O)
68
69%.o:	../../sh/%.c
70	$(COMPILE.c) $<
71	$(POST_PROCESS_O)
72
73$(CSH_PROG): $(COMMONOBJS) $(LOCALOBJS) $(MAPFILES)
74	$(LINK.c) $(COMMONOBJS) $(LOCALOBJS) -o $@ $(LDLIBS)
75	$(POST_PROCESS)
76
77$(HDDEP): ../sh.tconst.h
78
79$(ROOTPROG) := INSLINKTARGET=../has/bin/$(PROG)
80
81$(ROOTPROG):
82	$(INS.symlink)
83
84install: all $(ROOTHASBINPROG) $(ROOTPROG)
85
86clean:
87	$(RM) $(LOCALOBJS) $(COMMONOBJS)
88
89clobber:	clean
90	$(RM)  $(PROG)
91