xref: /illumos-gate/usr/src/tools/make/bin/Makefile (revision a192d1c0eb1d05a03ead3c7f898e864e4bf0399c)
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
14PROG=	make
15CMDDIR=	$(SRC)/cmd/make/bin
16OBJS=	ar.o		\
17	depvar.o	\
18	doname.o	\
19	dosys.o		\
20	files.o		\
21	globals.o	\
22	implicit.o	\
23	macro.o		\
24	main.o		\
25	misc.o		\
26	nse_printdep.o	\
27	parallel.o	\
28	pmake.o		\
29	read.o		\
30	read2.o		\
31	rep.o		\
32	state.o
33SRCS=$(OBJS:%.o:$(CMDDIR)/%.cc)
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
43ROOTLINKS = $(ROOTONBLDBINMACH)/dmake
44ROOTRULES = $(ROOTONBLDSHARE)/make.rules
45
46all:	$(PROG)
47
48install: all $(ROOTONBLDMACHPROG) $(ROOTLINKS) $(ROOTRULES)
49
50$(PROG):	$(OBJS)
51	$(LINK.cc) $(OBJS) -o $@ $(LDLIBS)
52	$(POST_PROCESS)
53
54%.o:	$(CMDDIR)/%.cc
55	$(COMPILE.cc) -o $@ $<
56
57$(ROOTONBLDBINMACH)/dmake:
58	-$(RM) $@; $(SYMLINK) ./make $@
59
60$(ROOTRULES) := FILEMODE = 0444
61
62$(ROOTONBLDSHARE)/%: $(CMDDIR)/%.file
63	$(INS.rename)
64
65
66lint:
67
68clean:
69	$(RM) $(OBJS)
70
71include $(SRC)/tools/Makefile.targ
72
73