xref: /illumos-gate/usr/src/test/libc-tests/tests/clocklock/Makefile (revision 90c28423f62864b8d977369710d815fd4227b5f0)
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
16PROG = clock_lock
17PROG32 = $(PROG:%=%.32)
18PROG64 = $(PROG:%=%.64)
19
20OBJS =	clock_lock.o \
21	clock_lock_cond.o \
22	clock_lock_mutex.o \
23	clock_lock_rwlock.o \
24	clock_lock_sem.o
25
26OBJS32 = $(OBJS:%.o=%.32.o)
27OBJS64 = $(OBJS:%.o=%.64.o)
28
29ROOTOPTDIR = $(ROOT)/opt/libc-tests/tests
30ROOTOPTPROGS =	$(PROG32:%=$(ROOTOPTDIR)/%) \
31		$(PROG64:%=$(ROOTOPTDIR)/%)
32
33include $(SRC)/cmd/Makefile.cmd
34include $(SRC)/cmd/Makefile.ctf
35
36CSTD = $(GNU_C99)
37CPPFLAGS += -D_REENTRANT
38CTF_MODE = link
39
40.KEEP_STATE:
41
42all: $(PROG32) $(PROG64)
43
44install: $(ROOTOPTPROGS) $(ROOTOPTDIR)
45
46$(ROOTOPTDIR):
47	$(INS.dir)
48
49$(ROOTOPTDIR)/%: %
50	$(INS.file)
51
52%.32.o: %.c
53	$(COMPILE.c) -o $@ $<
54	$(POST_PROCESS_O)
55
56%.32: $(OBJS32)
57	$(LINK.c) -o $@ $(OBJS32) $(LDLIBS)
58	$(POST_PROCESS)
59
60%.64.o: %.c
61	$(COMPILE64.c) -o $@ $<
62	$(POST_PROCESS_O)
63
64%.64: $(OBJS64)
65	$(LINK64.c) -o $@ $(OBJS64) $(LDLIBS64)
66	$(POST_PROCESS)
67
68clean:
69	$(RM) $(OBJS32) $(OBJS64)
70
71clobber: clean
72	$(RM) $(PROGS32) $(PROGS64)
73