xref: /illumos-gate/usr/src/test/tz-tests/tests/Makefile (revision 24a03f35583aede6d1aea859d90d76a3e6c2eb22)
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 2025 Oxide Computer Company
14#
15
16PROGS = \
17	tzload		\
18	zoneinfo_dump
19
20SCRIPTS = \
21	basic_tzs \
22	tz_dump
23
24PROGS32 = $(PROGS:%=%.32)
25PROGS64 = $(PROGS:%=%.64) \
26	tzparams.64 \
27	tzlist.64
28
29ROOTOPTDIR = $(ROOT)/opt/tz-tests
30ROOTOPTTESTS = $(ROOTOPTDIR)/tests
31ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTTESTS)/%) \
32	$(PROGS64:%=$(ROOTOPTTESTS)/%) \
33	$(SCRIPTS:%=$(ROOTOPTTESTS)/%)
34
35include $(SRC)/cmd/Makefile.cmd
36include $(SRC)/cmd/Makefile.ctf
37
38CSTD = $(CSTD_GNU17)
39CTF_MODE = link
40CPPFLAGS += -D_REENTRANT
41
42zoneinfo_dump.32 := LDLIBS += -lzoneinfo
43zoneinfo_dump.64 := LDLIBS64 += -lzoneinfo
44tzlist.64 := LDLIBS64 += -lzoneinfo
45
46.KEEP_STATE:
47
48all: $(PROGS32) $(PROGS64)
49
50install: $(ROOTOPTTESTS) .WAIT $(ROOTOPTPROGS)
51
52$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
53
54$(ROOTOPTDIR):
55	$(INS.dir)
56
57$(ROOTOPTTESTS): $(ROOTOPTDIR)
58	$(INS.dir)
59
60$(ROOTOPTTESTS)/%: %
61	$(INS.file)
62
63$(ROOTOPTTESTS)/%: %.ksh
64	$(INS.rename)
65
66%.64: %.c
67	$(LINK64.c) -o $@ $< $(LDLIBS64)
68	$(POST_PROCESS)
69
70%.32: %.c
71	$(LINK.c) -o $@ $< $(LDLIBS)
72	$(POST_PROCESS)
73
74clobber: $(SUBDIRS)
75	$(RM) $(PROGS32) $(PROGS64)
76
77$(SUBDIRS): FRC
78	@cd $@; pwd; $(MAKE) $(TARGET)
79
80FRC:
81