xref: /illumos-gate/usr/src/cmd/troff/troff.d/Makefile (revision 43449cdcd0600512dd862537f2cf014140dd0844)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# cmd/troff/troff.d/Makefile
26#
27# Copyright (c) 2019, Joyent, Inc.
28
29include 	../../Makefile.cmd
30
31PROG =		troff ta makedev
32
33SUBDIRS =	tmac.d
34
35TAOBJS =	draw.o ta.o
36MAKEDEVOBJS =	makedev.o
37TROFFOBJS =	t10.o t6.o
38COMMONOBJS =	hytab.o n1.o n2.o n3.o n4.o n5.o		\
39		n7.o n8.o n9.o ni.o nii.o suftab.o
40
41SRCS =		$(TAOBJS:%.o=%.c) $(MAKEDEVOBJS:%.o=%.c)	\
42		$(TROFFOBJS:%.o=%.c) $(COMMONOBJS:%.o=../%.c)
43
44TXTS =		README maketables troff.sh
45
46CPPFLAGS =	-DUSG -DINCORE -I. -I.. $(CPPFLAGS.master)
47
48CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
49CERRWARN +=	-_gcc=-Wno-unused-variable
50CERRWARN +=	-_gcc=-Wno-parentheses
51CERRWARN +=	$(CNOWARN_UNINIT)
52CERRWARN +=	-_gcc=-Wno-extra
53
54# "parse error: parsing (i (9223372034707292160-96) >= 65)"
55SMATCH =	off
56
57#
58# For message catalog
59#
60POFILES= $(TROFFOBJS:%.o=%.po) $(COMMONOBJS:%.o=../%.po)
61POFILE= troff.d.po
62
63# conditional assignments
64
65all :=		TARGET= all
66install :=	TARGET= install
67clean :=	TARGET= clean
68clobber :=	TARGET= clobber
69lint :=		TARGET= lint
70strip :=	TARGET= strip
71
72troff:=		POBJS=	$(COMMONOBJS) $(TROFFOBJS)
73ta:=		POBJS=	$(TAOBJS)
74makedev:=	POBJS=	$(MAKEDEVOBJS)
75
76ta:=		LDLIBS += -lm
77troff:=		LDLIBS += -lmapmalloc
78
79# build rule for common source above
80%.o: ../%.c
81		$(COMPILE.c) $<
82
83.KEEP_STATE:
84
85.PARALLEL: $(COMMONOBJS) $(TROFFOBJS) $(TAOBJS) $(MAKEDEVOBJS)
86
87all :		$(PROG) $(TXTS) $(SUBDIRS)
88
89$(PROG) :	$$(POBJS)
90		$(LINK.c) -o $@ $(POBJS) $(LDLIBS)
91		$(POST_PROCESS)
92
93install:	$(PROG) $(ROOTPROG) $(SUBDIRS)
94
95clean:		$(SUBDIRS)
96		$(RM) $(TAOBJS) $(MAKEDEVOBJS) $(TROFFOBJS) $(COMMONOBJS)
97
98catalog:        $(POFILE)
99
100$(POFILE):      $(POFILES)
101	$(RM)	$@
102	cat     $(POFILES)      > $@
103
104
105strip :
106		$(STRIP $(PROG)
107
108lint :		lint_SRCS
109
110include		../../Makefile.targ
111
112# additional dependency for clobber which is defined in Makefile.targ
113clobber:	$(SUBDIRS)
114
115$(SUBDIRS) :	FRC
116		@cd $@; pwd; $(MAKE) $(TARGET)
117
118FRC:
119