xref: /illumos-gate/usr/src/test/libc-tests/tests/clocklock/Makefile (revision 8b6b46dcb073dba71917d6a7309f0df7bad798a2)
1*8b6b46dcSRobert Mustacchi#
2*8b6b46dcSRobert Mustacchi# This file and its contents are supplied under the terms of the
3*8b6b46dcSRobert Mustacchi# Common Development and Distribution License ("CDDL"), version 1.0.
4*8b6b46dcSRobert Mustacchi# You may only use this file in accordance with the terms of version
5*8b6b46dcSRobert Mustacchi# 1.0 of the CDDL.
6*8b6b46dcSRobert Mustacchi#
7*8b6b46dcSRobert Mustacchi# A full copy of the text of the CDDL should have accompanied this
8*8b6b46dcSRobert Mustacchi# source.  A copy of the CDDL is also available via the Internet at
9*8b6b46dcSRobert Mustacchi# http://www.illumos.org/license/CDDL.
10*8b6b46dcSRobert Mustacchi#
11*8b6b46dcSRobert Mustacchi
12*8b6b46dcSRobert Mustacchi#
13*8b6b46dcSRobert Mustacchi# Copyright 2024 Oxide Computer Company
14*8b6b46dcSRobert Mustacchi#
15*8b6b46dcSRobert Mustacchi
16*8b6b46dcSRobert MustacchiPROG = clock_lock
17*8b6b46dcSRobert MustacchiPROG32 = $(PROG:%=%.32)
18*8b6b46dcSRobert MustacchiPROG64 = $(PROG:%=%.64)
19*8b6b46dcSRobert Mustacchi
20*8b6b46dcSRobert MustacchiOBJS =	clock_lock.o \
21*8b6b46dcSRobert Mustacchi	clock_lock_cond.o \
22*8b6b46dcSRobert Mustacchi	clock_lock_mutex.o \
23*8b6b46dcSRobert Mustacchi	clock_lock_rwlock.o \
24*8b6b46dcSRobert Mustacchi	clock_lock_sem.o
25*8b6b46dcSRobert Mustacchi
26*8b6b46dcSRobert MustacchiOBJS32 = $(OBJS:%.o=%.32.o)
27*8b6b46dcSRobert MustacchiOBJS64 = $(OBJS:%.o=%.64.o)
28*8b6b46dcSRobert Mustacchi
29*8b6b46dcSRobert MustacchiROOTOPTDIR = $(ROOT)/opt/libc-tests/tests
30*8b6b46dcSRobert MustacchiROOTOPTPROGS =	$(PROG32:%=$(ROOTOPTDIR)/%) \
31*8b6b46dcSRobert Mustacchi		$(PROG64:%=$(ROOTOPTDIR)/%)
32*8b6b46dcSRobert Mustacchi
33*8b6b46dcSRobert Mustacchiinclude $(SRC)/cmd/Makefile.cmd
34*8b6b46dcSRobert Mustacchi
35*8b6b46dcSRobert MustacchiCSTD = $(GNU_C99)
36*8b6b46dcSRobert MustacchiCPPFLAGS += -D_REENTRANT
37*8b6b46dcSRobert Mustacchi
38*8b6b46dcSRobert Mustacchi.KEEP_STATE:
39*8b6b46dcSRobert Mustacchi
40*8b6b46dcSRobert Mustacchiall: $(PROG32) $(PROG64)
41*8b6b46dcSRobert Mustacchi
42*8b6b46dcSRobert Mustacchiinstall: $(ROOTOPTPROGS) $(ROOTOPTDIR)
43*8b6b46dcSRobert Mustacchi
44*8b6b46dcSRobert Mustacchi$(ROOTOPTDIR):
45*8b6b46dcSRobert Mustacchi	$(INS.dir)
46*8b6b46dcSRobert Mustacchi
47*8b6b46dcSRobert Mustacchi$(ROOTOPTDIR)/%: %
48*8b6b46dcSRobert Mustacchi	$(INS.file)
49*8b6b46dcSRobert Mustacchi
50*8b6b46dcSRobert Mustacchi%.32.o: %.c
51*8b6b46dcSRobert Mustacchi	$(COMPILE.c) -o $@ $<
52*8b6b46dcSRobert Mustacchi	$(POST_PROCESS_O)
53*8b6b46dcSRobert Mustacchi
54*8b6b46dcSRobert Mustacchi%.32: $(OBJS32)
55*8b6b46dcSRobert Mustacchi	$(LINK.c) -o $@ $(OBJS32) $(LDLIBS)
56*8b6b46dcSRobert Mustacchi	$(POST_PROCESS)
57*8b6b46dcSRobert Mustacchi
58*8b6b46dcSRobert Mustacchi%.64.o: %.c
59*8b6b46dcSRobert Mustacchi	$(COMPILE64.c) -o $@ $<
60*8b6b46dcSRobert Mustacchi	$(POST_PROCESS_O)
61*8b6b46dcSRobert Mustacchi
62*8b6b46dcSRobert Mustacchi%.64: $(OBJS64)
63*8b6b46dcSRobert Mustacchi	$(LINK64.c) -o $@ $(OBJS64) $(LDLIBS64)
64*8b6b46dcSRobert Mustacchi	$(POST_PROCESS)
65*8b6b46dcSRobert Mustacchi
66*8b6b46dcSRobert Mustacchiclean:
67*8b6b46dcSRobert Mustacchi	$(RM) $(OBJS32) $(OBJS64)
68*8b6b46dcSRobert Mustacchi
69*8b6b46dcSRobert Mustacchiclobber: clean
70*8b6b46dcSRobert Mustacchi	$(RM) $(PROGS32) $(PROGS64)
71