xref: /illumos-gate/usr/src/test/os-tests/tests/ilstr/Makefile (revision 12fb9219923f41528f673d4f31667db2c3f103ff)
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 2023 Oxide Computer Company
14#
15
16PROGS = \
17	ilstr_basic
18
19PROGS32 = $(PROGS:%=%.32)
20PROGS64 = $(PROGS:%=%.64)
21
22COMOBJS = ilstr.o
23COMOBJS32 = $(COMOBJS:.o=.32.o)
24COMOBJS64 = $(COMOBJS:.o=.64.o)
25
26ROOTOPTDIR = $(ROOT)/opt/os-tests/tests
27ROOTOPTILSTR = $(ROOTOPTDIR)/ilstr
28ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTILSTR)/%) $(PROGS64:%=$(ROOTOPTILSTR)/%)
29
30include $(SRC)/cmd/Makefile.cmd
31include $(SRC)/cmd/Makefile.ctf
32
33LDLIBS += -lumem
34LDLIBS64 += -lumem
35
36CTF_MODE = link
37
38CSTD = $(GNU_C99)
39
40.KEEP_STATE:
41
42all: $(PROGS32) $(PROGS64)
43
44install: $(ROOTOPTPROGS)
45
46clean:
47	$(RM) $(COMOBJS32) $(COMOBJS64)
48
49$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTILSTR)
50
51$(ROOTOPTDIR):
52	$(INS.dir)
53
54$(ROOTOPTILSTR): $(ROOTOPTDIR)
55	$(INS.dir)
56
57$(ROOTOPTILSTR)/%: %
58	$(INS.file)
59
60%.32: %.c $(COMOBJS32)
61	$(LINK.c) -o $@ $^ $(LDLIBS)
62	$(POST_PROCESS)
63
64%.64: %.c $(COMOBJS64)
65	$(LINK64.c) -o $@ $^ $(LDLIBS64)
66	$(POST_PROCESS)
67
68%.32.o: $(SRC)/common/ilstr/%.c
69	$(COMPILE.c) $< -o $@
70	$(POST_PROCESS_O)
71
72%.64.o: $(SRC)/common/ilstr/%.c
73	$(COMPILE64.c) $< -o $@
74	$(POST_PROCESS_O)
75
76clobber: clean
77	$(RM) $(PROGS32) $(PROGS64)
78
79FRC:
80