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 (c) 2014 Joyent, Inc. 14 # 15 16 include $(SRC)/Makefile.master 17 18 ROOTOPTPKG = $(ROOT)/opt/util-tests 19 TESTDIR = $(ROOTOPTPKG)/tests/libnvpair_json 20 ROOTBINDIR = $(ROOTOPTPKG)/bin 21 22 PROG = print_json 23 24 SCRIPTS = \ 25 json_00_blank \ 26 json_01_boolean \ 27 json_02_numbers \ 28 json_03_empty_arrays \ 29 json_04_number_arrays \ 30 json_05_strings \ 31 json_06_nested \ 32 json_07_nested_arrays \ 33 json_common 34 35 include $(SRC)/cmd/Makefile.cmd 36 include $(SRC)/test/Makefile.com 37 38 OBJS = $(PROG:%=%.o) 39 SRCS = $(OBJS:%.o=%.c) 40 41 CMDS = $(PROG:%=$(ROOTBINDIR)/%) $(SCRIPTS:%=$(TESTDIR)/%) 42 $(CMDS) := FILEMODE = 0555 43 44 LDLIBS += -lnvpair 45 46 LINTFLAGS += -erroff=E_FUNC_ARG_UNUSED 47 48 all: $(PROG) 49 50 $(PROG): $(OBJS) 51 $(LINK.c) $(OBJS) -o $@ $(LDLIBS) 52 $(POST_PROCESS) 53 54 install: all $(CMDS) 55 56 lint: lint_SRCS 57 58 clobber: clean 59 -$(RM) $(PROG) 60 61 clean: 62 -$(RM) $(OBJS) 63 64 $(CMDS): $(TESTDIR) $(PROG) 65 66 $(ROOTBINDIR): 67 $(INS.dir) 68 69 $(ROOTBINDIR)/%: % 70 $(INS.file) 71 72 $(TESTDIR): 73 $(INS.dir) 74 75 $(TESTDIR)/%: %.ksh 76 $(INS.rename)