xref: /illumos-gate/usr/src/tools/lex/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 MNX Cloud, Inc.
14#
15
16PROG =		lex
17
18SGSDIR =	../../cmd/sgs
19SRCDIR =	$(SGSDIR)/lex/common
20
21OBJS =		main.o sub1.o sub2.o sub3.o header.o parser.o
22
23include ../Makefile.tools
24
25CPPFLAGS =	-I$(SGSDIR)/include
26CSTD=		$(CSTD_GNU99)
27
28# unused labels in yaccpar
29CERRWARN +=	-_gnu=-Wno-unused-label
30
31FORMS =		nceucform ncform nrform
32ROOTFORMS =	$(FORMS:%=$(ROOTONBLDSHLIBCCS)/%)
33
34.KEEP_STATE:
35
36all:	$(PROG)
37
38$(PROG):	$(OBJS)
39	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
40	$(POST_PROCESS)
41
42%.o:	$(SRCDIR)/%.c
43	$(COMPILE.c) -o $@ $<
44
45install: all $(ROOTONBLDMACHPROG) $(ROOTFORMS)
46
47clean:
48	$(RM) $(PROG) $(OBJS)
49
50$(ROOTONBLDSHLIBCCS)/%: $(SRCDIR)/%
51	$(INS.file)
52
53include	../Makefile.targ
54