xref: /illumos-gate/usr/src/tools/make/bin/Makefile (revision faeaba889049371f163f3deb6efd690dbc986e3d)
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
16CMDDIR=	$(SRC)/cmd/make/bin
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
34
35include ../../Makefile.tools
36include ../Makefile.com
37
38LDLIBS += ../lib/mksh/libmksh.a ../lib/vroot/libvroot.a
39LDLIBS += ../lib/bsd/libbsd.a -lc -lnsl -lumem
40
41CPPFLAGS += -D_FILE_OFFSET_BITS=64
42
43CCERRWARN += -_gcc=-Wno-unused-variable
44CCERRWARN += -_gcc=-Wno-switch
45CCERRWARN += -_gcc=-Wno-parentheses
46CCERRWARN += -_gcc=-Wno-unused-function
47CCERRWARN += -_gcc=-Wno-clobbered
48CCERRWARN += -_gcc=-Wno-uninitialized
49
50ROOTLINKS = $(ROOTONBLDBINMACH)/dmake
51ROOTRULES = $(ROOTONBLDSHARE)/make.rules
52
53all:	$(PROG)
54
55install: all $(ROOTONBLDMACHPROG) $(ROOTLINKS) $(ROOTRULES)
56
57$(PROG):	$(OBJS)
58	$(LINK.cc) $(OBJS) -o $@ $(LDLIBS)
59	$(POST_PROCESS)
60
61%.o:	$(CMDDIR)/%.cc
62	$(COMPILE.cc) -o $@ $<
63
64$(ROOTONBLDBINMACH)/dmake:
65	-$(RM) $@; $(SYMLINK) ./make $@
66
67$(ROOTRULES) := FILEMODE = 0444
68
69$(ROOTONBLDSHARE)/%: $(CMDDIR)/%.file
70	$(INS.rename)
71
72
73lint:
74
75clean:
76	$(RM) $(OBJS)
77
78include $(SRC)/tools/Makefile.targ
79
80