Makefile revision bf56214c0556fa6864189c826d39dbe156bb22a0
5cd4555ad444fd391002ae32450572054369fd42Rob Austein#
5cd4555ad444fd391002ae32450572054369fd42Rob Austein# CDDL HEADER START
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein#
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# The contents of this file are subject to the terms of the
5c6b95ba1b2e35f8dd6b0a7f25aacba91fff3aa2Tinderbox User# Common Development and Distribution License (the "License").
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# You may not use this file except in compliance with the License.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington#
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# or http://www.opensolaris.org/os/licensing.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# See the License for the specific language governing permissions
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# and limitations under the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews#
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews#
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# CDDL HEADER END
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews#
f30785f506a522ed6a5e394af2bb13b6f883927eEvan Hunt#
b5ad6dfea4cc3e7d1d322ac99f1e5a31096837c4Mark Andrews# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# Use is subject to license terms.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#ident "%Z%%M% %I% %E% SMI"
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# This makefile drives the production of the usbprn kernel driver.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# sparc architecture dependent
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# uts/sparc/usbprn/Makefile
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Path to the base of the uts directory tree (usually /usr/src/uts).
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein#
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinUTSBASE = ../..
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
141132c272ebc41da4c55d69c49810fafadbbc11Mark Andrews#
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews# Define the module and object file sets.
d60212e03fbef1d3dd7f7eb05c0545cc373cb9fcAutomatic Updater#
20f2d1d74b67d096f858dc70cedf9af6dcc38dc7Automatic UpdaterMODULE = usbprn
339d2a4d4b3b2e0be9e43afec6e84fe468edfaeeAutomatic UpdaterOBJECTS = $(USBPRN_OBJS:%=$(OBJS_DIR)/%)
3b398443f0dca316ba7a6e057ba2d1b8ab4ddf70Tinderbox UserLINTS = $(USBPRN_OBJS:%.o=$(LINTS_DIR)/%.ln)
5c6b95ba1b2e35f8dd6b0a7f25aacba91fff3aa2Tinderbox UserROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinWARLOCK_OUT = $(USBPRN_OBJS:%.o=%.ll)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinWARLOCK_OK = $(MODULE).ok
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinWLCMD_DIR = $(UTSBASE)/common/io/warlock
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein#
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Include common rules.
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews#
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeininclude $(UTSBASE)/sparc/Makefile.sparc
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# lint pass one enforcement
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
a903095bf4512dae561c7f6fc7854a51bebf334aMark AndrewsCFLAGS += $(CCVERBOSE)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# depends on misc/usba
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonLDFLAGS += -dy -Nmisc/usba
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# Define targets
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews#
bca7f81db58d4803fb6d8d352132445cf61eb1acMark AndrewsALL_TARGET = $(BINARY)
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonLINT_TARGET = $(MODULE).lint
a26ad011f382d12058478704cb5e90e6f4366d01Andreas GustafssonINSTALL_TARGET = $(BINARY) $(ROOTMODULE)
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews#
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews# For now, disable these lint checks; maintainers should endeavor
578e3196076b409c509c6c0a0873e7bfe54f4d61Evan Hunt# to investigate and remove these for maximum lint coverage.
c5223c9cb7c22620d5ee6611228673e95b48a270Mark Andrews# Please do not carry these forward to new Makefiles.
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews#
c5223c9cb7c22620d5ee6611228673e95b48a270Mark AndrewsLINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
dc6da18ccbb808d21f123cc6bda399b44ad11445Mark AndrewsLINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
4d9f3f00d93fcb8743b1105e8cf82e862be220d1Mark Andrews
f30785f506a522ed6a5e394af2bb13b6f883927eEvan Hunt.KEEP_STATE:
4025076ca2822fc420830c97eb6597294a5a1faaFrancis Dupont
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrewsall: $(ALL_DEPS)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
dc6da18ccbb808d21f123cc6bda399b44ad11445Mark Andrewsdef: $(DEF_DEPS)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
26bb3b7a67b833f0a18072567de036226890ca1aMark Andrewsclean: $(CLEAN_DEPS)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrewsclobber: $(CLOBBER_DEPS)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrewslint: $(LINT_DEPS)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrewsmodlintlib: $(MODLINTLIB_DEPS)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrewsclean.lint: $(CLEAN_LINT_DEPS)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrewsinstall: $(INSTALL_DEPS)
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
dc6da18ccbb808d21f123cc6bda399b44ad11445Mark Andrews#
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews# Include common targets.
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews#
578e3196076b409c509c6c0a0873e7bfe54f4d61Evan Huntinclude $(UTSBASE)/sparc/Makefile.targ
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews#
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews# Defines for local commands.
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews#
f30785f506a522ed6a5e394af2bb13b6f883927eEvan HuntWARLOCK = warlock
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark AndrewsWLCC = wlcc
a903095bf4512dae561c7f6fc7854a51bebf334aMark AndrewsTOUCH = touch
43efd9fa56b03e3e285fb58859efc9348c7f4a9fMark AndrewsTEST = test
26bb3b7a67b833f0a18072567de036226890ca1aMark Andrews
43efd9fa56b03e3e285fb58859efc9348c7f4a9fMark Andrews#
d0aebc5a55b6145297d94f8aee939852357c59fcMark Andrews# lock_lint rules
508f61f8d699c46f962b682f388e54b446a7194dMark Andrews#
38397492000c996d50f9bf96a4da318a742bd07cEvan HuntUSBA_FILES = $(USBA_OBJS:%.o=../usba/%.ll)
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonUHCI_FILES = $(UHCI_OBJS:%.o=../uhci/%.ll)
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonOHCI_FILES = $(OHCI_OBJS:%.o=../ohci/%.ll)
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonEHCI_FILES = $(EHCI_OBJS:%.o=../ehci/%.ll)
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtonwarlock: $(WARLOCK_OK) warlock_with_usba
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellington$(WARLOCK_OK): $(WARLOCK_OUT) $(WLCMD_DIR)/usbprn.wlcmd warlock_ddi.files
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(WARLOCK) -c $(WLCMD_DIR)/usbprn.wlcmd $(WARLOCK_OUT) \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein -l ../warlock/ddi_dki_impl.ll
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(TOUCH) $@
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein%.ll: $(UTSBASE)/common/io/usb/clients/printer/%.c \
c40265eba0c99708887d68e67901924065ba2514Brian Wellington $(UTSBASE)/common/sys/usb/clients/printer/usbprn.h
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews $(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrewswarlock_with_usba: $(WLCMD_DIR)/usbprn_with_usba.wlcmd $(WARLOCK_OUT) \
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews usba_files ohci_files ehci_files uhci_files warlock_ddi.files
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews $(WARLOCK) -c $(WLCMD_DIR)/usbprn_with_usba.wlcmd \
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews $(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews $(WARLOCK_OUT) \
8b9fc7617b8f54641708c985697848e6cc10a5bbMark Andrews -l ../warlock/ddi_dki_impl.ll
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrews
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrewsusba_files:
728a9bec1fe3a56fedfd672e7f34d2d82631d1d7Mark Andrews @cd ../usba;pwd; $(MAKE) warlock
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtonohci_files:
c40265eba0c99708887d68e67901924065ba2514Brian Wellington @cd ../ohci;pwd; $(MAKE) warlock
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtonuhci_files:
c40265eba0c99708887d68e67901924065ba2514Brian Wellington @cd ../uhci;pwd; $(MAKE) warlock
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtonehci_files:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein @cd ../ehci;pwd; $(MAKE) warlock
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinwarlock_ddi.files:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein cd ../warlock; pwd; $(MAKE) warlock
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein