xref: /illumos-gate/usr/src/tools/yacc/Makefile (revision 2e07277863d69344215bd0c72e171d0c854dbe56)
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#
13# Copyright 2024 Toomas Soome <tsoome@me.com>
14#
15
16PROG =		yacc
17
18SGSDIR =	../../cmd/sgs
19SRCDIR =	$(SGSDIR)/yacc/common
20
21OBJS =		y1.o y2.o y3.o y4.o
22
23YACCPAR =	yaccpar
24
25include ../Makefile.tools
26
27CPPFLAGS =	-I$(SGSDIR)/include
28CSTD =		$(CSTD_GNU99)
29
30ROOTYACCPAR =	$(YACCPAR:%=$(ROOTONBLDSHLIBCCS)/%)
31
32.KEEP_STATE:
33
34all:	$(PROG)
35
36$(PROG):	$(OBJS)
37	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
38	$(POST_PROCESS)
39
40%.o:	$(SRCDIR)/%.c
41	$(COMPILE.c) -o $@ $<
42
43install: all $(ROOTONBLDMACHPROG) $(ROOTYACCPAR)
44
45$(ROOTONBLDSHLIBCCS)/%: $(SRCDIR)/%
46	$(INS.file)
47
48clean:
49	$(RM) $(PROG) $(OBJS)
50
51include	../Makefile.targ
52