xref: /titanic_51/usr/src/test/libc-tests/tests/Makefile.com (revision 538aa54d819fa7751ca82bcc30d4ed8c57ec2ef2)
1*538aa54dSGarrett D'Amore#
2*538aa54dSGarrett D'Amore# This file and its contents are supplied under the terms of the
3*538aa54dSGarrett D'Amore# Common Development and Distribution License ("CDDL"), version 1.0.
4*538aa54dSGarrett D'Amore# You may only use this file in accordance with the terms of version
5*538aa54dSGarrett D'Amore# 1.0 of the CDDL.
6*538aa54dSGarrett D'Amore#
7*538aa54dSGarrett D'Amore# A full copy of the text of the CDDL should have accompanied this
8*538aa54dSGarrett D'Amore# source.  A copy of the CDDL is also available via the Internet at
9*538aa54dSGarrett D'Amore# http://www.illumos.org/license/CDDL.
10*538aa54dSGarrett D'Amore#
11*538aa54dSGarrett D'Amore
12*538aa54dSGarrett D'Amore#
13*538aa54dSGarrett D'Amore# Copyright (c) 2012 by Delphix. All rights reserved.
14*538aa54dSGarrett D'Amore# Copyright 2014 Garrett D'Amore <garrett@damore.org>
15*538aa54dSGarrett D'Amore#
16*538aa54dSGarrett D'Amore
17*538aa54dSGarrett D'Amoreinclude $(SRC)/Makefile.master
18*538aa54dSGarrett D'Amoreinclude $(SRC)/cmd/Makefile.cmd
19*538aa54dSGarrett D'Amoreinclude $(SRC)/test/Makefile.com
20*538aa54dSGarrett D'Amore
21*538aa54dSGarrett D'Amore$(OBJS_OVERRIDE)OBJS = $(PROG).o test_common.o
22*538aa54dSGarrett D'AmoreOBJS32 = $(OBJS:%.o=%.$(MACH).o)
23*538aa54dSGarrett D'AmorePROG32 = $(PROG).$(MACH)
24*538aa54dSGarrett D'Amore
25*538aa54dSGarrett D'Amore$(BUILD64) OBJS64 = $(OBJS:%.o=%.$(MACH64).o)
26*538aa54dSGarrett D'Amore$(BUILD64) PROG64= $(PROG).$(MACH64)
27*538aa54dSGarrett D'Amore
28*538aa54dSGarrett D'Amore$(OBJS_OVERRIDE)SRCS = $(PROG).c ../common/test_common.c
29*538aa54dSGarrett D'Amore
30*538aa54dSGarrett D'AmoreC99MODE = -xc99=%all
31*538aa54dSGarrett D'AmoreLINTFLAGS += -I../common -DARCH=\"ARCH\" -DLINT
32*538aa54dSGarrett D'AmoreCPPFLAGS += -I../common
33*538aa54dSGarrett D'Amore
34*538aa54dSGarrett D'AmoreROOTOPTPKG = $(ROOT)/opt/libc-tests
35*538aa54dSGarrett D'AmoreTESTDIR = $(ROOTOPTPKG)/tests
36*538aa54dSGarrett D'Amore
37*538aa54dSGarrett D'AmoreCMDS = $(PROG32:%=$(TESTDIR)/%) $(PROG64:%=$(TESTDIR)/%) \
38*538aa54dSGarrett D'Amore	$(KSHPROG:%=$(TESTDIR)/%) $(ARCHPROG:%=$(TESTDIR)/%)
39*538aa54dSGarrett D'Amore$(CMDS) := FILEMODE = 0555
40*538aa54dSGarrett D'Amore
41*538aa54dSGarrett D'Amoreall: $(PROG32) $(PROG64) $(KSHPROG) $(ARCHPROG) $(SUBDIRS)
42*538aa54dSGarrett D'Amore
43*538aa54dSGarrett D'Amore$(PROG32): $(OBJS32)
44*538aa54dSGarrett D'Amore	$(LINK.c) $(OBJS32) -o $@ $(LDLIBS)
45*538aa54dSGarrett D'Amore	$(POST_PROCESS)
46*538aa54dSGarrett D'Amore
47*538aa54dSGarrett D'Amore$(PROG64): $(OBJS64)
48*538aa54dSGarrett D'Amore	$(LINK64.c) $(OBJS64) -o $@ $(LDLIBS64)
49*538aa54dSGarrett D'Amore	$(POST_PROCESS)
50*538aa54dSGarrett D'Amore
51*538aa54dSGarrett D'Amore$(KSHPROG): $(KSHPROG).ksh
52*538aa54dSGarrett D'Amore	$(RM) $@
53*538aa54dSGarrett D'Amore	$(CP) $(KSHPROG).ksh $(@)
54*538aa54dSGarrett D'Amore	$(CHMOD) +x $@
55*538aa54dSGarrett D'Amore
56*538aa54dSGarrett D'Amore$(ARCHPROG): ../common/run_arch_tests.ksh
57*538aa54dSGarrett D'Amore	$(RM) $@
58*538aa54dSGarrett D'Amore	$(CP) ../common/run_arch_tests.ksh $(@)
59*538aa54dSGarrett D'Amore	$(CHMOD) +x $@
60*538aa54dSGarrett D'Amore
61*538aa54dSGarrett D'Amore%.$(MACH).o: %.c
62*538aa54dSGarrett D'Amore	$(COMPILE.c) -o $@ $(CFLAGS_$(MACH)) -DARCH=\"$(MACH)\" $<
63*538aa54dSGarrett D'Amore
64*538aa54dSGarrett D'Amore%.$(MACH).o: ../common/%.c
65*538aa54dSGarrett D'Amore	$(COMPILE.c) -o $@ $(CFLAGS_$(MACH)) -DARCH=\"$(MACH)\" $<
66*538aa54dSGarrett D'Amore
67*538aa54dSGarrett D'Amore%.$(MACH64).o: %.c
68*538aa54dSGarrett D'Amore	$(COMPILE64.c) -o $@ $(CFLAGS_$(MACH64)) -DARCH=\"$(MACH64)\" $<
69*538aa54dSGarrett D'Amore
70*538aa54dSGarrett D'Amore%.$(MACH64).o: ../common/%.c
71*538aa54dSGarrett D'Amore	$(COMPILE64.c) -o $@ $(CFLAGS_$(MACH64)) -DARCH=\"$(MACH64)\" $<
72*538aa54dSGarrett D'Amore
73*538aa54dSGarrett D'Amoreinstall: $(SUBDIRS) $(CMDS)
74*538aa54dSGarrett D'Amore
75*538aa54dSGarrett D'Amorelint: lint_SRCS
76*538aa54dSGarrett D'Amore
77*538aa54dSGarrett D'Amoreclobber: clean
78*538aa54dSGarrett D'Amore	-$(RM) $(PROG32) $(PROG64) $(KSHPROG) $(ARCHPROG)
79*538aa54dSGarrett D'Amore
80*538aa54dSGarrett D'Amoreclean:
81*538aa54dSGarrett D'Amore	-$(RM) $(OBJS32) $(OBJS64)
82*538aa54dSGarrett D'Amore
83*538aa54dSGarrett D'Amore$(CMDS): $(TESTDIR) $(PROG32) $(PROG64) $(KSHPROG) $(ARCHPROG)
84*538aa54dSGarrett D'Amore
85*538aa54dSGarrett D'Amore$(TESTDIR):
86*538aa54dSGarrett D'Amore	$(INS.dir)
87*538aa54dSGarrett D'Amore
88*538aa54dSGarrett D'Amore$(TESTDIR)/%: %
89*538aa54dSGarrett D'Amore	$(INS.file)
90