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 2021 OmniOS Community Edition (OmniOSce) Association.
14#
15
16include $(SRC)/cmd/Makefile.cmd
17include $(SRC)/test/Makefile.com
18
19PROG = definit_test.32 definit_test.64
20
21OBJS = definit.o definit_test.o
22OBJS32 = $(OBJS:.o=.32.o)
23OBJS64 = $(OBJS:.o=.64.o)
24
25DATAFILES = init.data init.expected
26
27CSTD = $(CSTD_GNU99)
28CPPFLAGS += -I$(SRC)/common/definit
29
30ROOTOPTPKG = $(ROOT)/opt/os-tests
31TESTDIR = $(ROOTOPTPKG)/tests/definit
32
33CMDS = $(PROG:%=$(TESTDIR)/%) $(TESTDIR)/definit
34$(CMDS) := FILEMODE = 0555
35DATA = $(DATAFILES:%=$(TESTDIR)/%)
36$(DATA) := FILEMODE = 0444
37
38LDLIBS += -lc
39LDLIBS64 += -lc
40
41all: $(PROG)
42
43install: $(CMDS) $(DATA)
44
45clobber: clean
46	-$(RM) $(PROG)
47
48clean:
49	-$(RM) $(OBJS32) $(OBJS64)
50
51$(CMDS): $(TESTDIR) $(PROG)
52
53$(TESTDIR):
54	$(INS.dir)
55
56$(TESTDIR)/%: %
57	$(INS.file)
58
59$(TESTDIR)/%: %.ksh
60	$(INS.rename)
61
62%.32.o: %.c
63	$(COMPILE.c) $< -o $@
64
65%.64.o: %.c
66	$(COMPILE64.c) $< -o $@
67
68%.32.o: $(SRC)/common/definit/%.c
69	$(COMPILE.c) $< -o $@
70
71%.64.o: $(SRC)/common/definit/%.c
72	$(COMPILE64.c) $< -o $@
73
74definit_test.64: $(OBJS64)
75	$(LINK64.c) -o $@ $(OBJS64) $(LDLIBS64)
76	$(POST_PROCESS)
77
78definit_test.32: $(OBJS32)
79	$(LINK.c) -o $@ $(OBJS32) $(LDLIBS)
80	$(POST_PROCESS)
81
82
83