xref: /illumos-gate/usr/src/test/i2c-tests/i2csimd/Makefile (revision 0cbe48189888d02563dba9c90132ac391ba233b6)
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
16PROG = i2csimd
17OBJS = i2csimd.o \
18	i2csimd_at24c.o \
19	i2csimd_pca9548.o \
20	i2csimd_ts511x.o \
21	bitext.o
22MANIFEST = i2csimd.xml
23
24ROOTOPTDIR = $(ROOT)/opt/i2c-tests/svc
25ROOTOPTPROGS = $(PROG:%=$(ROOTOPTDIR)/%)
26
27include $(SRC)/cmd/Makefile.cmd
28include $(SRC)/cmd/Makefile.cmd.64
29include $(SRC)/cmd/Makefile.ctf
30
31CSTD = $(CSTD_GNU17)
32CPPFLAGS += -I$(SRC)/uts/common/io/i2c/ctrl/i2csim
33CTF_MODE = link
34ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
35
36$(ROOTMANIFEST) := FILEMODE = 0444
37
38.KEEP_STATE:
39
40all: $(PROG)
41
42install: $(ROOTOPTPROGS) $(ROOTMANIFEST)
43
44$(ROOTOPTDIR):
45	$(INS.dir)
46
47$(ROOTOPTDIR)/%: % $(ROOTOPTDIR)
48	$(INS.file)
49
50%.o: $(SRC)/common/bitext/%.c
51	$(COMPILE.c) $< -o $@
52	$(POST_PROCESS_O)
53
54$(PROG): $(OBJS)
55	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
56	$(POST_PROCESS)
57
58clean:
59	$(RM) $(OBJS)
60
61clobber: clean
62	$(RM) $(PROG)
63
64check: $(CHKMANIFEST)
65