xref: /illumos-gate/usr/src/test/os-tests/tests/hexdump/Makefile (revision 43379a280422204006ceee5a5c5380444cb515d9)
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 Oxide Computer Company
14#
15
16PROGS = \
17	hexdump_basic
18
19DATAFILES = \
20	_input		\
21	addr1		\
22	addr2		\
23	address		\
24	address+header	\
25	align1		\
26	ascii		\
27	basic		\
28	dedup		\
29	default		\
30	doublespace	\
31	group2		\
32	group4		\
33	group8		\
34	header		\
35	indent		\
36	marker1		\
37	narrow1		\
38	narrow2		\
39	wide1		\
40	width12
41
42PROGS32 = $(PROGS:%=%.32)
43PROGS64 = $(PROGS:%=%.64)
44
45COMOBJS = hexdump.o ilstr.o
46COMOBJS32 = $(COMOBJS:.o=.32.o)
47COMOBJS64 = $(COMOBJS:.o=.64.o)
48
49ROOTOPTDIR = $(ROOT)/opt/os-tests/tests
50ROOTOPTHEXDUMP = $(ROOTOPTDIR)/hexdump
51ROOTOPTDATADIR = $(ROOTOPTHEXDUMP)/data
52ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTHEXDUMP)/%) $(PROGS64:%=$(ROOTOPTHEXDUMP)/%)
53ROOTOPTDATA = $(DATAFILES:%=$(ROOTOPTDATADIR)/%)
54
55$(ROOTOPTDATA) := FILEMODE = 0444
56
57include $(SRC)/cmd/Makefile.cmd
58include $(SRC)/cmd/Makefile.ctf
59
60LDLIBS += -lumem
61LDLIBS64 += -lumem
62
63CTF_MODE = link
64
65CSTD = $(GNU_C99)
66
67.KEEP_STATE:
68
69all: $(PROGS32) $(PROGS64)
70
71install: $(ROOTOPTPROGS) $(ROOTOPTDATA)
72
73clean:
74	$(RM) $(COMOBJS32) $(COMOBJS64)
75
76$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTHEXDUMP)
77
78$(ROOTOPTDATA): $(ROOTOPTDATADIR)
79
80$(ROOTOPTDIR):
81	$(INS.dir)
82
83$(ROOTOPTHEXDUMP): $(ROOTOPTDIR)
84	$(INS.dir)
85
86$(ROOTOPTDATADIR): $(ROOTOPTHEXDUMP)
87	$(INS.dir)
88
89$(ROOTOPTHEXDUMP)/%: %
90	$(INS.file)
91
92%.32: %.c $(COMOBJS32)
93	$(LINK.c) -o $@ $^ $(LDLIBS)
94	$(POST_PROCESS)
95
96%.64: %.c $(COMOBJS64)
97	$(LINK64.c) -o $@ $^ $(LDLIBS64)
98	$(POST_PROCESS)
99
100%.32.o: $(SRC)/common/hexdump/%.c
101	$(COMPILE.c) $< -o $@
102	$(POST_PROCESS_O)
103
104%.64.o: $(SRC)/common/hexdump/%.c
105	$(COMPILE64.c) $< -o $@
106	$(POST_PROCESS_O)
107
108%.32.o: $(SRC)/common/ilstr/%.c
109	$(COMPILE.c) $< -o $@
110	$(POST_PROCESS_O)
111
112%.64.o: $(SRC)/common/ilstr/%.c
113	$(COMPILE64.c) $< -o $@
114	$(POST_PROCESS_O)
115
116clobber: clean
117	$(RM) $(PROGS32) $(PROGS64)
118
119FRC:
120