Makefiles need to specify C99 mode consistently
[unleashed.git] / usr / src / test / libc-tests / tests / Makefile.com
blob8e9b83b2c4becf4e2538c0e2ffaf042c070d93d6
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.
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.
13 # Copyright (c) 2012 by Delphix. All rights reserved.
14 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
17 include $(SRC)/Makefile.master
18 include $(SRC)/cmd/Makefile.cmd
19 include $(SRC)/test/Makefile.com
21 $(OBJS_OVERRIDE)OBJS = $(PROG).o test_common.o
22 OBJS32 = $(OBJS:%.o=%.$(MACH).o)
23 PROG32 = $(PROG).$(MACH)
25 $(BUILD64) OBJS64 = $(OBJS:%.o=%.$(MACH64).o)
26 $(BUILD64) PROG64= $(PROG).$(MACH64)
28 $(OBJS_OVERRIDE)SRCS = $(PROG).c ../common/test_common.c
30 CSTD = $(CSTD_GNU99)
31 CPPFLAGS += -I$(ROOT)/usr/include -I../common
33 ROOTOPTPKG = $(ROOT)/opt/libc-tests
34 TESTDIR = $(ROOTOPTPKG)/tests/$(TESTSUBDIR)
36 CMDS = $(PROG32:%=$(TESTDIR)/%) $(PROG64:%=$(TESTDIR)/%) \
37         $(KSHPROG:%=$(TESTDIR)/%) $(ARCHPROG:%=$(TESTDIR)/%) \
38         $(EXTRAPROG:%=$(TESTDIR)/%)
40 $(CMDS) := FILEMODE = 0555
42 all: $(PROG32) $(PROG64) $(KSHPROG) $(ARCHPROG) $(SUBDIRS)
44 $(PROG32): $(OBJS32)
45         $(LINK.c) $(OBJS32) -o $@ $(LDLIBS)
46         $(POST_PROCESS)
48 $(PROG64): $(OBJS64)
49         $(LINK64.c) $(OBJS64) -o $@ $(LDLIBS64)
50         $(POST_PROCESS)
52 $(KSHPROG): $(KSHPROG).ksh
53         $(RM) $@
54         $(CP) $(KSHPROG).ksh $(@)
55         $(CHMOD) +x $@
57 $(ARCHPROG): ../common/run_arch_tests.ksh
58         $(RM) $@
59         $(CP) ../common/run_arch_tests.ksh $(@)
60         $(CHMOD) +x $@
62 %.$(MACH).o: %.c
63         $(COMPILE.c) -o $@ $(CFLAGS_$(MACH)) -DARCH=\"$(MACH)\" $<
65 %.$(MACH).o: ../common/%.c
66         $(COMPILE.c) -o $@ $(CFLAGS_$(MACH)) -DARCH=\"$(MACH)\" $<
68 %.$(MACH64).o: %.c
69         $(COMPILE64.c) -o $@ $(CFLAGS_$(MACH64)) -DARCH=\"$(MACH64)\" $<
71 %.$(MACH64).o: ../common/%.c
72         $(COMPILE64.c) -o $@ $(CFLAGS_$(MACH64)) -DARCH=\"$(MACH64)\" $<
74 install: $(SUBDIRS) $(CMDS)
76 clobber: clean
77         -$(RM) $(PROG32) $(PROG64) $(KSHPROG) $(ARCHPROG)
79 clean:
80         -$(RM) $(OBJS32) $(OBJS64)
82 $(CMDS): $(TESTDIR) $(PROG32) $(PROG64) $(KSHPROG) $(ARCHPROG)
84 $(TESTDIR):
85         $(INS.dir)
87 $(TESTDIR)/%: %
88         $(INS.file)