1*bc1f688bSRobert Mustacchi# 2*bc1f688bSRobert Mustacchi# This file and its contents are supplied under the terms of the 3*bc1f688bSRobert Mustacchi# Common Development and Distribution License ("CDDL"), version 1.0. 4*bc1f688bSRobert Mustacchi# You may only use this file in accordance with the terms of version 5*bc1f688bSRobert Mustacchi# 1.0 of the CDDL. 6*bc1f688bSRobert Mustacchi# 7*bc1f688bSRobert Mustacchi# A full copy of the text of the CDDL should have accompanied this 8*bc1f688bSRobert Mustacchi# source. A copy of the CDDL is also available via the Internet at 9*bc1f688bSRobert Mustacchi# http://www.illumos.org/license/CDDL. 10*bc1f688bSRobert Mustacchi# 11*bc1f688bSRobert Mustacchi 12*bc1f688bSRobert Mustacchi# 13*bc1f688bSRobert Mustacchi# Copyright 2015 Joyent, Inc. 14*bc1f688bSRobert Mustacchi# 15*bc1f688bSRobert Mustacchi 16*bc1f688bSRobert Mustacchiinclude $(SRC)/Makefile.master 17*bc1f688bSRobert Mustacchi 18*bc1f688bSRobert MustacchiROOTOPTPKG = $(ROOT)/opt/util-tests 19*bc1f688bSRobert MustacchiTESTDIR = $(ROOTOPTPKG)/tests/mergeq 20*bc1f688bSRobert Mustacchi 21*bc1f688bSRobert MustacchiPROG = mqt 22*bc1f688bSRobert MustacchiOBJS = mqt.o mergeq.o 23*bc1f688bSRobert Mustacchi 24*bc1f688bSRobert Mustacchiinclude $(SRC)/cmd/Makefile.cmd 25*bc1f688bSRobert Mustacchiinclude $(SRC)/cmd/Makefile.ctf 26*bc1f688bSRobert Mustacchiinclude $(SRC)/test/Makefile.com 27*bc1f688bSRobert Mustacchi 28*bc1f688bSRobert MustacchiCMDS = $(PROG:%=$(TESTDIR)/%) 29*bc1f688bSRobert Mustacchi$(CMDS) := FILEMODE = 0555 30*bc1f688bSRobert Mustacchi 31*bc1f688bSRobert MustacchiCPPFLAGS += -I$(SRC)/lib/mergeq -D_REENTRANT 32*bc1f688bSRobert MustacchiLDLIBS += -lumem 33*bc1f688bSRobert Mustacchi 34*bc1f688bSRobert Mustacchiall: $(PROG) 35*bc1f688bSRobert Mustacchi 36*bc1f688bSRobert Mustacchiinstall: all $(CMDS) 37*bc1f688bSRobert Mustacchi 38*bc1f688bSRobert Mustacchilint: lint_SRCS 39*bc1f688bSRobert Mustacchi 40*bc1f688bSRobert Mustacchiclobber: clean 41*bc1f688bSRobert Mustacchi -$(RM) $(PROG) 42*bc1f688bSRobert Mustacchi 43*bc1f688bSRobert Mustacchiclean: 44*bc1f688bSRobert Mustacchi -$(RM) $(OBJS) 45*bc1f688bSRobert Mustacchi 46*bc1f688bSRobert Mustacchi%.o: %.c 47*bc1f688bSRobert Mustacchi $(COMPILE.c) -o $@ -c $< 48*bc1f688bSRobert Mustacchi $(POST_PROCESS_O) 49*bc1f688bSRobert Mustacchi 50*bc1f688bSRobert Mustacchi%.o: $(SRC)/lib/mergeq/%.c 51*bc1f688bSRobert Mustacchi $(COMPILE.c) -o $@ -c $< 52*bc1f688bSRobert Mustacchi $(POST_PROCESS_O) 53*bc1f688bSRobert Mustacchi 54*bc1f688bSRobert Mustacchi$(PROG): $(OBJS) 55*bc1f688bSRobert Mustacchi $(LINK.c) $(OBJS) -o $@ $(LDLIBS) 56*bc1f688bSRobert Mustacchi $(POST_PROCESS) 57*bc1f688bSRobert Mustacchi 58*bc1f688bSRobert Mustacchi$(CMDS): $(TESTDIR) $(PROG) 59*bc1f688bSRobert Mustacchi 60*bc1f688bSRobert Mustacchi$(TESTDIR): 61*bc1f688bSRobert Mustacchi $(INS.dir) 62*bc1f688bSRobert Mustacchi 63*bc1f688bSRobert Mustacchi$(TESTDIR)/%: % 64*bc1f688bSRobert Mustacchi $(INS.file) 65