xref: /illumos-gate/usr/src/test/crypto-tests/tests/longhash/Makefile.longhash (revision 8119dad84d6416f13557b0ba8e2aaf9064cbcfd3)
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 Bill Sommerfeld <sommerfeld@hamachi.org>
14#
15
16TESTDIR	= $(ROOT)/opt/crypto-tests/tests/longhash
17
18include $(SRC)/cmd/Makefile.cmd
19include $(SRC)/test/Makefile.com
20include $(SRC)/cmd/Makefile.ctf
21
22PROGS_32 = $(BASEPROG)_32
23PROGS_64 = $(BASEPROG)_64
24PROGS = $(PROGS_32) $(PROGS_64)
25
26COMMON_OBJS_32 = $(COMMON_OBJS:%.o=%.32.o)
27COMMON_OBJS_64 = $(COMMON_OBJS:%.o=%.64.o)
28
29COMMONDIR = $(SRC)/test/crypto-tests/tests/common
30
31$(PROGS_32) := OBJS += $(BASEPROG:%=%.32.o) $(COMMON_OBJS_32)
32$(PROGS_64) := OBJS += $(BASEPROG:%=%.64.o) $(COMMON_OBJS_64)
33$(PROGS_64) := LDLIBS += $(LDLIBS64)
34
35LDLIBS += -lmd
36
37CSTD = $(CSTD_GNU99)
38
39CMDS = $(PROGS:%=$(TESTDIR)/%)
40
41$(CMDS) := FILEMODE = 0555
42
43all: $(PROGS)
44
45%_32: %.32.o $(COMMON_OBJS_32)
46	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
47	$(POST_PROCESS)
48
49%_64: %.64.o $(COMMON_OBJS_64)
50	$(LINK64.c) $(OBJS) -o $@ $(LDLIBS)
51	$(POST_PROCESS)
52
53%.32.o: %.c
54	$(COMPILE.c) -o $@ $<
55	$(POST_PROCESS_O)
56
57%.64.o: %.c
58	$(COMPILE64.c) -o $@ $<
59	$(POST_PROCESS_O)
60
61install: all $(CMDS)
62
63clobber: clean
64	-$(RM) $(PROGS)
65
66clean:
67	-$(RM) *.o $(PROGS)
68
69$(CMDS): $(TESTDIR) $(PROGS)
70
71$(TESTDIR):
72	$(INS.dir)
73
74$(TESTDIR)/%_32: %_32
75	$(INS.file)
76
77$(TESTDIR)/%_64: %_64
78	$(INS.file)
79