xref: /illumos-gate/usr/src/cmd/make/bin/Makefile (revision 65bed588e62c7f3a0da5d65fcc588b46b470f5a7)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12# Copyright 2015, Richard Lowe.
13# Copyright 2019 RackTop Systems.
14
15PROG=	make
16POFILE=	make.po
17OBJS=	ar.o		\
18	depvar.o	\
19	doname.o	\
20	dosys.o		\
21	files.o		\
22	globals.o	\
23	implicit.o	\
24	macro.o		\
25	main.o		\
26	misc.o		\
27	nse_printdep.o	\
28	parallel.o	\
29	pmake.o		\
30	read.o		\
31	read2.o		\
32	rep.o		\
33	state.o
34POFILES= $(OBJS:%.o=%.po)
35
36include ../../Makefile.cmd
37include ../Makefile.com
38
39LDLIBS += ../lib/mksh/libmksh.a ../lib/vroot/libvroot.a
40LDLIBS += ../lib/bsd/libbsd.a -lc -lnsl -lumem
41
42CPPFLAGS += -D_FILE_OFFSET_BITS=64
43
44CCERRWARN += -_gcc=-Wno-unused-variable
45CCERRWARN += -_gcc=-Wno-switch
46CCERRWARN += -_gcc=-Wno-parentheses
47CCERRWARN += -_gcc=-Wno-unused-function
48CCERRWARN += -_gcc=-Wno-clobbered
49CCERRWARN += -_gcc=-Wno-uninitialized
50
51ROOTLINKS = $(ROOTCCSBIN)/make $(ROOTXPG4BIN)/make $(ROOTBIN)/dmake $(ROOTCCSLIB)/svr4.make \
52	$(ROOTLIB)/svr4.make
53
54ROOTRULES = $(ROOTSHLIB)/make/make.rules $(ROOTSHLIB)/make/svr4.make.rules
55
56all:	$(PROG)
57
58install: all $(ROOTPROG) $(ROOTLINKS) $(ROOTRULES)
59
60$(PROG):	$(OBJS)
61	$(LINK.cc) $(OBJS) -o $@ $(LDLIBS)
62	$(POST_PROCESS)
63
64$(ROOTCCSBIN)/make:
65	-$(RM) $@; $(SYMLINK) ../../bin/make $@
66
67$(ROOTCCSLIB)/svr4.make:
68	-$(RM) $@; $(SYMLINK) ../../bin/make $@
69
70$(ROOTLIB)/svr4.make:
71	-$(RM) $@; $(SYMLINK) ../bin/make $@
72
73$(ROOTXPG4BIN)/make:
74	-$(RM) $@; $(SYMLINK) ../../bin/make $@
75
76$(ROOTBIN)/dmake:
77	-$(RM) $@; $(SYMLINK) ./make $@
78
79$(ROOTRULES) := FILEMODE = 0444
80
81$(ROOTRULES): $(ROOTSHLIB)/make
82
83$(ROOTSHLIB)/make: FRC
84	$(INS.dir)
85
86$(ROOTSHLIB)/make/%: %.file
87	$(INS.rename)
88
89clean:
90	$(RM) $(OBJS)
91
92FRC:
93
94include ../../Makefile.targ
95
96