Makefile revision 229
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift#
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# CDDL HEADER START
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift#
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# The contents of this file are subject to the terms of the
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# Common Development and Distribution License (the "License").
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# You may not use this file except in compliance with the License.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift#
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# or http://www.opensolaris.org/os/licensing.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# See the License for the specific language governing permissions
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# and limitations under the License.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift#
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# When distributing Covered Code, include this CDDL HEADER in each
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# If applicable, add the following below this CDDL HEADER, with the
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# fields enclosed by brackets "[]" replaced with your own identifying
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# information: Portions Copyright [yyyy] [name of copyright owner]
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift#
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# CDDL HEADER END
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift#
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift#
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftinclude ../../../../../make-rules/shared-macros.mk
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftincdir = /usr/include
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftlibdir = /usr/lib
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftdocdir = /usr/share/doc/libusb
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftLIBNAME = libusb.so.1
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftSRCS = wr_libusb.c
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftOBJS = $(SRCS:%.c=%.o)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftTEST = testlibusb
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftMAPFILES = libusb.mapfile
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftCFLAGS += $(CC_PIC)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftCFLAGS += -I.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftCFLAGS += -D_REENTRANT -D_TS_ERRNO
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftLDFLAGS += $(MAPFILES:%=-M %)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftLIBS += -ldl -lc
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftall: $(LIBNAME)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift$(LIBNAME): $(OBJS)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift $(LD) $(LDFLAGS) -G -h $@ -o $@ $(OBJS) $(LIBS)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftinstall: $(LIBNAME)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift$(TEST): $(TEST:%=%.o)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift $(CC) -o $@ $< -lusb
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftcheck: all $(TEST)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift LD_LIBRARY_PATH=. ./$(TEST)
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swiftclean:
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift $(RM) $(TEST) $(LIBNAME) *.o
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift