xref: /illumos-gate/usr/src/test/libc-tests/tests/clocklock/Makefile (revision 90c28423f62864b8d977369710d815fd4227b5f0)
18b6b46dcSRobert Mustacchi#
28b6b46dcSRobert Mustacchi# This file and its contents are supplied under the terms of the
38b6b46dcSRobert Mustacchi# Common Development and Distribution License ("CDDL"), version 1.0.
48b6b46dcSRobert Mustacchi# You may only use this file in accordance with the terms of version
58b6b46dcSRobert Mustacchi# 1.0 of the CDDL.
68b6b46dcSRobert Mustacchi#
78b6b46dcSRobert Mustacchi# A full copy of the text of the CDDL should have accompanied this
88b6b46dcSRobert Mustacchi# source.  A copy of the CDDL is also available via the Internet at
98b6b46dcSRobert Mustacchi# http://www.illumos.org/license/CDDL.
108b6b46dcSRobert Mustacchi#
118b6b46dcSRobert Mustacchi
128b6b46dcSRobert Mustacchi#
138b6b46dcSRobert Mustacchi# Copyright 2024 Oxide Computer Company
148b6b46dcSRobert Mustacchi#
158b6b46dcSRobert Mustacchi
168b6b46dcSRobert MustacchiPROG = clock_lock
178b6b46dcSRobert MustacchiPROG32 = $(PROG:%=%.32)
188b6b46dcSRobert MustacchiPROG64 = $(PROG:%=%.64)
198b6b46dcSRobert Mustacchi
208b6b46dcSRobert MustacchiOBJS =	clock_lock.o \
218b6b46dcSRobert Mustacchi	clock_lock_cond.o \
228b6b46dcSRobert Mustacchi	clock_lock_mutex.o \
238b6b46dcSRobert Mustacchi	clock_lock_rwlock.o \
248b6b46dcSRobert Mustacchi	clock_lock_sem.o
258b6b46dcSRobert Mustacchi
268b6b46dcSRobert MustacchiOBJS32 = $(OBJS:%.o=%.32.o)
278b6b46dcSRobert MustacchiOBJS64 = $(OBJS:%.o=%.64.o)
288b6b46dcSRobert Mustacchi
298b6b46dcSRobert MustacchiROOTOPTDIR = $(ROOT)/opt/libc-tests/tests
308b6b46dcSRobert MustacchiROOTOPTPROGS =	$(PROG32:%=$(ROOTOPTDIR)/%) \
318b6b46dcSRobert Mustacchi		$(PROG64:%=$(ROOTOPTDIR)/%)
328b6b46dcSRobert Mustacchi
338b6b46dcSRobert Mustacchiinclude $(SRC)/cmd/Makefile.cmd
34*90c28423SRobert Mustacchiinclude $(SRC)/cmd/Makefile.ctf
358b6b46dcSRobert Mustacchi
368b6b46dcSRobert MustacchiCSTD = $(GNU_C99)
378b6b46dcSRobert MustacchiCPPFLAGS += -D_REENTRANT
38*90c28423SRobert MustacchiCTF_MODE = link
398b6b46dcSRobert Mustacchi
408b6b46dcSRobert Mustacchi.KEEP_STATE:
418b6b46dcSRobert Mustacchi
428b6b46dcSRobert Mustacchiall: $(PROG32) $(PROG64)
438b6b46dcSRobert Mustacchi
448b6b46dcSRobert Mustacchiinstall: $(ROOTOPTPROGS) $(ROOTOPTDIR)
458b6b46dcSRobert Mustacchi
468b6b46dcSRobert Mustacchi$(ROOTOPTDIR):
478b6b46dcSRobert Mustacchi	$(INS.dir)
488b6b46dcSRobert Mustacchi
498b6b46dcSRobert Mustacchi$(ROOTOPTDIR)/%: %
508b6b46dcSRobert Mustacchi	$(INS.file)
518b6b46dcSRobert Mustacchi
528b6b46dcSRobert Mustacchi%.32.o: %.c
538b6b46dcSRobert Mustacchi	$(COMPILE.c) -o $@ $<
548b6b46dcSRobert Mustacchi	$(POST_PROCESS_O)
558b6b46dcSRobert Mustacchi
568b6b46dcSRobert Mustacchi%.32: $(OBJS32)
578b6b46dcSRobert Mustacchi	$(LINK.c) -o $@ $(OBJS32) $(LDLIBS)
588b6b46dcSRobert Mustacchi	$(POST_PROCESS)
598b6b46dcSRobert Mustacchi
608b6b46dcSRobert Mustacchi%.64.o: %.c
618b6b46dcSRobert Mustacchi	$(COMPILE64.c) -o $@ $<
628b6b46dcSRobert Mustacchi	$(POST_PROCESS_O)
638b6b46dcSRobert Mustacchi
648b6b46dcSRobert Mustacchi%.64: $(OBJS64)
658b6b46dcSRobert Mustacchi	$(LINK64.c) -o $@ $(OBJS64) $(LDLIBS64)
668b6b46dcSRobert Mustacchi	$(POST_PROCESS)
678b6b46dcSRobert Mustacchi
688b6b46dcSRobert Mustacchiclean:
698b6b46dcSRobert Mustacchi	$(RM) $(OBJS32) $(OBJS64)
708b6b46dcSRobert Mustacchi
718b6b46dcSRobert Mustacchiclobber: clean
728b6b46dcSRobert Mustacchi	$(RM) $(PROGS32) $(PROGS64)
73