# $Id: Makefile.master 743 2012-06-18 06:10:35Z elkner $
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
# Portions Copyright 2011,2012 Jens Elkner
# to lazy to create clutter like pre.master.mk, so we do it here, but only for
# the absolutely necessary vars required by the Makefile to work properly
MAKECONFIG = config.mk
CONFIG_H = configure.h
TEXT_DOMAIN = k10sensor
INCLUDESUBDIR = k10sensor
#MAKEFILESUFFIX = .solaris
# base directory of the ON build tools to use for building kernel modules
################### STD STUFF - no further changes needed ##################
# Build per default 64bit binaries. For 32bit just use dmake BT= ...
BTcheck:sh = if [ -n "${BT}" ]; then echo \${BT} ; else echo 64 ; fi
BT = $(BTcheck)
PRE_POUND= pre\#
POUND_SIGN= $(PRE_POUND:pre\%=%)
ROOT =
PREFIX= /usr
# flag to make install silent
#INSTALL_SILENT = -s
MACH:sh = uname -p
MACH64_1 = $(MACH:sparc=sparcv9)
MACH64 = $(MACH64_1:i386=amd64)
PKGCONFIG = pkg-config
K_CC = ${ONBLD_TOOLS}/bin/${MACH}/cw
K_CTFCONVERT = $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert
K_CTFMERGE = $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge
CAT = cat
ECHO = echo
LS = ls
CPUS = LC_CTYPE=C && $(PSRINFO) | $(WC) -l
# one may use DMAKE_MAX_JOBS=$(JOBS:sh) to define max. number of jobs for dmake
JOBS = $(ECHO) $(CPUS:sh)'*2+2' | $(BC)
# set to '.1' if no 'mapfile 2' support
if [ $$? -ne 0 ]; then $(ECHO) '.1' ; else true ; fi
CHECK = $(PRINTF) '*=$* \n<=$< \n@=$@ \n?=$? \n%=$% \n@D=$(@D) \n@F=$(@F) \n'
FILEMODE = 644
DIRMODE = 755
INS.file = $(RM) $@; $(INS) $(INSTALL_SILENT) -m $(FILEMODE) -f $(@D) $<
ROOTETC = $(ROOT)/etc
ROOTUSR = $(ROOT)/$(PREFIX)
ROOTUSRSBIN = $(ROOTUSR)/sbin
ROOTUSRBIN = $(ROOTUSR)/bin
ROOTUSRLIB = $(ROOTUSR)/lib
ROOTSHARE = $(ROOTUSR)/share
ROOTPKGCONFIG = $(ROOTUSRLIB)/pkgconfig
ROOTMAN = $(ROOTSHARE)/man
ROOTMAN1 = $(ROOTMAN)/man1
ROOTMAN1M = $(ROOTMAN)/man1m
ROOTINCLUDE = $(ROOTUSR)/include
ROOTSUBINCLUDE = $(ROOTINCLUDE)/$(INCLUDESUBDIR)
ROOTLOCALE = $(ROOTSHARE)/locale
ROOTUSRKRNL = $(ROOTUSR)/kernel
ROOTUSRKDRV = $(ROOTUSRKRNL)/drv
ROOTUSRKDRVMACH = $(ROOTUSRKDRV)/$(MACH$(BT):i386=)
LINKMOD_DIR = linkmod
DEVFSADM_DIR = devfsadm
ROOTLIB_DEVFSADM = $(ROOTUSRLIB)/$(DEVFSADM_DIR)
ROOTLIB_DEVFSADM_LINKMOD = $(ROOTLIB_DEVFSADM)/$(LINKMOD_DIR)
ROOTETCFILES = $(ETCFILES:%=$(ROOTETC)/%)
$(ROOTETCFILES) := FILEMODE = 0644
ROOTPROG = $(PROG:%=$(ROOTUSRBIN)/%)
$(ROOTPROG) := FILEMODE = 0555
ROOTSBINPROG = $(SBINPROG:%=$(ROOTUSRSBIN)/%)
$(ROOTSBINPROG) := FILEMODE = 0555
ROOTMAN1FILES = $(MAN1FILES:%=$(ROOTMAN1)/%)
$(ROOTMAN1FILES) := FILEMODE= 444
ROOTMAN1MFILES = $(MAN1MFILES:%=$(ROOTMAN1M)/%)
$(ROOTMAN1MFILES) := FILEMODE= 444
ROOTPKGCONFIGFILES = $(PKGCONFIGFILES:%=$(ROOTPKGCONFIG)/%)
$(ROOTPKGCONFIGFILES) := FILEMODE= 444
ROOTINCLUDEFILES = $(INCLUDEFILES:%=$(ROOTSUBINCLUDE)/%)
$(ROOTINCLUDEFILES) := FILEMODE= 444
ROOTLIB_DEVFSADM_LINKMODFILES = $(DEVFSADM_LINKMODFILES:%=$(ROOTLIB_DEVFSADM_LINKMOD)/%)
$(ROOTLIB_DEVFSADM_LINKMODFILES) := FILEMODE= 755
$(MACH)_PKGCONFIGPATH = $(ROOTPKGCONFIG)
$(MACH64)_PKGCONFIGPATH = $(ROOTUSRLIB)/$(MACH64)/pkgconfig $(MACH)_PKGCONFIGPATH)
PKGCONFIGPATH += $($(MACH)_PKGCONFIGPATH)
PKGCONFIGPATH64 += $($(MACH64)_PKGCONFIGPATH)
$(ROOTETC)/%: $(ROOTETC) %
$(INS.file)
$(ROOTUSRBIN)/%: $(ROOTUSRBIN) %
$(INS.file)
$(ROOTUSRSBIN)/%: $(ROOTUSRSBIN) %
$(INS.file)
$(ROOTMAN1)/%: $(ROOTMAN1) %
$(INS.file)
$(ROOTMAN1M)/%: $(ROOTMAN1M) %
$(INS.file)
$(ROOTPKGCONFIG)/%: $(ROOTPKGCONFIG) %
$(INS.file)
#$(ROOTINCLUDE)/%: $(ROOTINCLUDE) %
# $(INS.file)
$(ROOTSUBINCLUDE)/%: $(ROOTSUBINCLUDE) %
$(INS.file)
$(ROOTLOCALE)/%: $(ROOTLOCALE) %
$(INS.file)
$(ROOTLIB_DEVFSADM_LINKMOD)/%: $(ROOTLIB_DEVFSADM_LINKMOD) %
$(INS.file)
$(ROOT):
$(INS.dir)
$(ROOTETC):
$(INS.dir)
$(ROOTUSR):
$(INS.dir)
$(ROOTUSRSBIN):
$(INS.dir)
$(ROOTUSRBIN):
$(INS.dir)
$(ROOTUSRLIB):
$(INS.dir)
$(ROOTSHARE):
$(INS.dir)
$(ROOTMAN):
$(INS.dir)
$(ROOTMAN1):
$(INS.dir)
$(ROOTMAN1M):
$(INS.dir)
$(ROOTPKGCONFIG):
$(INS.dir)
$(ROOTLOCALE):
$(INS.dir)
$(ROOTINCLUDE):
$(INS.dir)
$(ROOTSUBINCLUDE):
$(INS.dir)
$(ROOTLOCALE):
$(INS.dir)
$(ROOTLIB_DEVFSADM):
$(INS.dir)
$(ROOTLIB_DEVFSADM_LINKMOD):
$(INS.dir)
BDIRECT = -Bdirect
BDYNAMIC = -Bdynamic
BLOCAL = -Blocal
BNODIRECT = -Bnodirect
BREDUCE = -Breduce
BSTATIC = -Bstatic
ZDEFS = -zdefs
ZDIRECT = -zdirect
ZIGNORE = -zignore
ZINITFIRST = -zinitfirst
ZINTERPOSE = -zinterpose
ZLAZYLOAD = -zlazyload
ZLOADFLTR = -zloadfltr
ZMULDEFS = -zmuldefs
ZNODEFAULTLIB = -znodefaultlib
ZNODEFS = -znodefs
ZNODELETE = -znodelete
ZNODLOPEN = -znodlopen
ZNODUMP = -znodump
ZNOLAZYLOAD = -znolazyload
ZNOLDYNSYM = -znoldynsym
ZNORELOC = -znoreloc
ZNOVERSION = -znoversion
ZRECORD = -zrecord
ZREDLOCSYM = -zredlocsym
ZTEXT = -ztext
ZVERBOSE = -zverbose
GSHARED = -G
CCMT = -mt
sparc_DTRACEFLAGS = -32
sparcv9_DTRACEFLAGS = -64
i386_DTRACEFLAGS = -32
amd64_DTRACEFLAGS = -64
DTRACEFLAGS = $($(MACH)_DTRACEFLAGS)
DTRACEFLAGS64 = $($(MACH64)_DTRACEFLAGS)
# set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings
# from the compiler about places the -xarch=v9 may differ from -xarch=v9c.
V9ABIWARN=
# set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register
# symbols (used to detect conflicts between objects that use global registers)
# we disable this now for safety, and because genunix does not link with
# this feature (the v9 default) enabled.
#
# REGSYM is separate since the C++ driver syntax is different.
CCREGSYM= -Wc,-Qiselect-regsym=0
CCCREGSYM= -Qoption cg -Qiselect-regsym=0
# Prevent the removal of static symbols by the SPARC code generator (cg).
# The x86 code generator (ube) does not remove such symbols and as such
# using this workaround is not applicable for x86.
#
CCSTATICSYM = -Wc,-Qassembler-ounrefsym=0
#
# generate 32-bit addresses in the v9 kernel. Saves memory.
CCABS32 = -Wc,-xcode=abs32
# When -g is used, the compiler globalizes static objects
# (gives them a unique prefix). Disable that.
CNOGLOBAL = -W0,-noglobal
# Direct the Sun Studio compiler to use a static globalization prefix based on
# the name of the module rather than something unique. Otherwise, objects
# will not build deterministically, as subsequent compilations of identical
# source will yeild objects that always look different.
#
# In the same spirit, this will also remove the date from the N_OPT stab.
CGLOBALSTATIC = -W0,-xglobalstatic
# Normally, gcc uses indirect DWARF strings to save space. However,
# this causes relocations that ctfconvert cannot handle. Disable this.
CDWARFSTR = -_gcc=-fno-dwarf2-indirect-strings
# The Sun Studio 11 compiler has changed the behaviour of integer
# wrap arounds and so a flag is needed to use the legacy behaviour
#
sparc_IROPTFLAG = -W2,-xwrap_int
sparcv9_IROPTFLAG = -W2,-xwrap_int
i386_IROPTFLAG =
amd64_IROPTFLAG =
IROPTFLAG = $($(MACH)_IROPTFLAG)
IROPTFLAG64 = $($(MACH64)_IROPTFLAG)
sparc_C_PICFLAGS = -K pic
sparcv_C_PICFLAGS = -K pic
i386_C_PICFLAGS = -K pic
amd64_C_PICFLAGS = -K pic
C_PICFLAGS = $($(MACH)_C_PICFLAGS)
C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
sparc_C_BIGPICFLAGS = -K PIC
sparcv9_C_BIGPICFLAGS = -K PIC
i386_C_BIGPICFLAGS = -K PIC
amd64_C_BIGPICFLAGS = -K PIC
C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
CCMODE = -Xa
CCMODE64 = -Xa
CCVERBOSE = -v
XDEPEND = -xdepend
XFFLAG = -xF=%all
XESS = -xs
XSTRCONST = -xstrconst
C99_ENABLE = -xc99=%all
C99_DISABLE = -xc99=%none
C99MODE = $(C99_DISABLE)
C99LMODE = $(C99MODE:-xc99%=-Xc99%)
sparc_XARCH = -m32
sparc_COPTFLAG = -xO3
sparc_CFLAGS = $(sparc_XARCH) -dalign $(CCVERBOSE) $(CCSTATICSYM)
sparcv9_XARCH = -m64
sparcv9_COPTFLAG = -xO3
sparcv9_CFLAGS = $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) \
$(CCREGSYM) $(CCSTATICSYM)
i386_XARCH = -m32
i386_COPTFLAG = -O
i386_CFLAGS = $(i386_XARCH)
amd64_XARCH = -m64 -Ui386 -U__i386
amd64_COPTFLAG = -xO3
amd64_CFLAGS = $(amd64_XARCH)
COPTFLAG = $($(MACH)_COPTFLAG)
COPTFLAG64 = $($(MACH64)_COPTFLAG)
# ADDITONAL KERNEL FLAGS
sparc_STAND_FLAGS =
sparcv9_STAND_FLAGS =
i386_STAND_FLAGS =
amd64_STAND_FLAGS = -xmodel=kernel
sparc_STAND_FLAGS_GCC = -_gcc=-ffreestanding $(CDWARFSTR)
sparcv9_STAND_FLAGS_GCC = -_gcc=-ffreestanding $(CDWARFSTR)
i386_STAND_FLAGS_GCC = -_gcc=-ffreestanding $(CDWARFSTR)
amd64_STAND_FLAGS_GCC = $(CDWARFSTR)
STAND_FLAGS_GCC = $($(MACH)_STAND_FLAGS_GCC)
STAND_FLAGS_GCC64 = $($(MACH64)_STAND_FLAGS_GCC)
#
STAND_FLAGS = $($(MACH)_STAND_FLAGS)
STAND_FLAGS64 = $($(MACH64)_STAND_FLAGS)
#
SAVEARGS = -Wu,-save_args
amd64_STAND_FLAGS += $(SAVEARGS)
#
# Disable the incremental linker
ILDOFF = -xildoff
# Default debug format for Sun Studio 11 is dwarf, so force it to generate stabs
DEBUGFORMAT = -xdebugformat=stabs
# Flags used to build in debug mode for ctf generation. Bugs in the Devpro
# compilers currently prevent us from building with cc-emitted DWARF.
CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL)
CTF_FLAGS_i386 = -g $(C99MODE) $(CNOGLOBAL)
CTF_FLAGS = $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT)
# Tradeoff time for space (smaller is better wrt. kernel)
sparc_SPACEFLAG = -xspace -W0,-Lt
sparcv9_SPACEFLAG = -xspace -W0,-Lt
i386_SPACEFLAG = -xspace
amd64_SPACEFLAG =
#
SPACEFLAG = $($(MACH)_SPACEFLAG)
SPACEFLAG64 = $($(MACH64)_SPACEFLAG)
#
ALWAYS_DEFS = -D_KERNEL -D_SYSCALL32 -D_DDI_STRICT
ALWAYS_DEFS64 = -D_KERNEL -D_SYSCALL32 -D_SYSCALL32_IMPL -D_ELF64 \
-D_DDI_STRICT
# should be added by the compiler
CC_DEFS = -Dsun -D__sun -D__SVR4
#
KFLAGS = $(STAND_FLAGS) $(CCVERBOSE) $(XSTRCONST) $(ALWAYS_DEFS) \
$(CTF_FLAGS) $(CC_DEFS)
KFLAGS64 = $(STAND_FLAGS64) $(CCVERBOSE) $(XSTRCONST) $(ALWAYS_DEFS64) \
$(CTF_FLAGS) $(CC_DEFS)
CTFCVTFLAGS = -i -l $(KMODULE)
CTFMRGFLAGS = -l $(KMODULE)
CERRWARN = -errtags=yes -errwarn=%all
CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
CFLAGS = $(COPTFLAG) $($(MACH)_CFLAGS) $(CCMODE) $(CERRWARN) $(C99MODE) \
$(IROPTFLAG) $(CGLOBALSTATIC) $(ILDOFF) $(SPACEFLAG)
CFLAGS64 = $(COPTFLAG64) $($(MACH64)_CFLAGS) $(CCMODE64) $(CERRWARN) \
$(C99MODE) $(IROPTFLAG64) $(CGLOBALSTATIC) $(ILDOFF) $(SPACEFLAG64)
DYNFLAGS = $(ZTEXT) $(ZDEFS) $(BDIRECT)
DTEXTDOM = -DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
DTS_ERRNO = -D_TS_ERRNO
$(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
CPPFLAGS = $(CPPFLAGS.master)
.c:
$(LINK$(BT:32=).c) -o $@ $< $(LDLIBS)
.c.o:
$(COMPILE$(BT:32=).c) $(OUTPUT_OPTION) $<
# GETTEXT stuff
GNUXGETFLAGS = --add-comments=TRANSLATION_NOTE --keyword=_ --strict \
--no-location --omit-header
XGETFLAGS = -c TRANSLATION_NOTE
MSGFMTFLAGS = -s
MSGMERGEFLAGS =
POFILE = $(TEXT_DOMAIN).po
# old stuff, should only be used, if there is a special reason for it. Usage:
# target: $(POFILES)
#POFILES = $(SRCS:%.c=%.po) - is the old way.
POFILES = $(MSGFILES:%.c=%.po)
MOFILES = $(LOCALES:%=%.mo)
.SUFFIXES: $(SUFFIXES) .i .po .mo .ko
.c.i:
$(CPPFORPO) $< > $@
$(CPPFORPO) $< > $<.i
$(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
$(RM) $@ ;\
[ -r $(<F).po ] && $(SED) "/^domain/d" < $(<F).po > $@ ;\
$(RM) $(<F).po $<.i
LC_CTYPE="en_US" ; $(MSGFMT) $(MSGFMTFLAGS) -o $@ $<
$(COMPILE$(BT:32=).c) -o $@ $(OUTPUT_OPTION) $<
$(CTFCONVERT) $(CTFCVTFLAGS) $@
.c~.ko:
$(SCCSCHECK) $<
# special handling for kernel binaries
%.ko := CFLAGS$(BT:32=) += $(KFLAGS$(BT:32=))
%.ko := C99MODE = $(C99_ENABLE)
%.ko := CERRWARN = -errtags=yes -errwarn=%all
@$(ECHO) "Building $(POFILE) for $(MSGFILES) ..."
$(TOUCH) _$(TEXT_DOMAIN).po; \
$(XGETTEXT) $(XGETFLAGS) $(MSGFILES); \
$(SED) -e '/^\# msgid/,/^\# msgstr/d' -e '/^domain/d' \
-e '/^\#$$/d' -e '/^\#, /d' \
$(RM) messages.po _$(TEXT_DOMAIN).po
@$(ECHO) "Building $(POFILE) done."
MSGROOT = $(ROOT)/catalog
MSGDOMAIN = $(MSGROOT)/$(TEXT_DOMAIN)
MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
$(MSGDOMAIN)%:
$(INS.dir)
$(MSGDOMAINPOFILE): $(MSGDOMAIN) $(POFILE)
$(RM) $@; $(CP) $(POFILE) $@
_msg: $(MSGDOMAINPOFILE)
.PARALLEL: $(POFILES) $(MSGFILES)
ROOTLOCALEDIRS = $(LOCALES:%=$(ROOTLOCALE)/%/LC_MESSAGES)
ROOTLOCALEFILES = $(LOCALES:%=$(ROOTLOCALE)/%/LC_MESSAGES/$(POFILE:%.po=%.mo)
pomerge: $(POFILE)
@[ -n "$(LOCALES)" ] && \
for f in $(LOCALES) ; do \
$(MSGMERGE) $(MSGMERGEFLAGS) -U "$${f}.po" $(POFILE) ; \
done
$(ROOTLOCALEDIRS):
$(INS.dir)
moinstall := FILEMODE = 0444
moinstall: $(MOFILES) $(ROOTLOCALEDIRS)
@[ -n "$(MOFILES)" ] && \
for f in $(MOFILES) ; do \
BN="$${f##*/}"; L="$${BN%.mo}"; DST="$(ROOTLOCALE)/$$L/LC_MESSAGES"; \
$(RM) "$$DST/$$BN"; \
$(INS) $(INSTALL_SILENT) -m $(FILEMODE) -f "$$DST" "$$f" || exit 1; \
done
# splitted to make redefinition easier
INSTALL.etc = $(ROOTETCFILES)
INSTALL.bin = $(ROOTPROG) $(ROOTSBINPROG)
INSTALL.man = $(ROOTMAN1MFILES) $(ROOTMAN1FILES)
INSTALL.pc = $(ROOTPKGCONFIGFILES)
INSTALL.inc = $(ROOTINCLUDEFILES)
INSTALL.mo = moinstall
install := TARGET = install
clean := TARGET = clean
clobber := TARGET = clobber
$(SUBDIRS): FRC
@cd $@; \
pwd; echo "==== $(MAKE) -f Makefile$(MAKEFILESUFFIX) $(TARGET) ====" ; \
$(MAKE) ROOT=$(ROOT) -f Makefile$(MAKEFILESUFFIX) BT=$(BT) $(TARGET)
FRC:
# NOTE: $(SUBDIRS) must come before any of the above defined targets with the
# dyn. TARGET: it doesn't get reset, after the dependency has been solved!
# E.g. If current target would be 'clobber: clean $(SUBDIRS)', on entrance
# TARGET==clobber. However, than clean target gets called and in turn
# TARGET set to 'clean'. After clean the targets of $(SUBDIRS) gets called,
# but with TARGET==clean, i.e. the 'clobber' targets of $(SUBDIRS) will
# never be called!
install: $(SUBDIRS) all $(INSTALL.all)
CLOBBERFILES += $(MAKECONFIG) $(CONFIG_H)
CLOBBERFILES += $(POFILE)
clobber: $(SUBDIRS) clean
$(RM) $(CLOBBERFILES) && ( sleep 1; $(RM) .make.state )&
@if [[ x"$(CLOBBERDIRS)" != x"" ]]; then \
echo "rmdir -ps $(CLOBBERDIRS)" ; \
CDIRS="" ; \
for AD in " " $(CLOBBERDIRS) ; do \
[[ -d $$AD ]] && CDIRS="$$CDIRS $$AD" ; \
done ; \
if [[ -n $$CDIRS ]]; then \
rmdir -ps $$CDIRS ; \
else \
true ; \
fi ; \
else true ; fi
CLEANFILES += $(PROG) $(SBINPROG) *.o $(POFILES) $(MOFILES) core $(KMODULE) *.ko
clean: $(SUBDIRS)
$(RM) $(CLEANFILES)
#.PARALLEL: clobber clean
%.1m: %.1
X=$@ ; $(CP) -p $${X%m} $@
OBJS = $(SRCS:%.c=%.o) $(OBJS2)
KOBJS = $(KSRCS:%.c=%.ko) $(KOBJS2)
PICS = $(LIB_SRCS:%.c=pics/%.o)
DYNLIB = $(LIBRARY:.a=.so$(VERS))
SONAME = $(DYNLIB)
LIBS = $(DYNLIB)
CLEANFILES += $(PICS)
CLOBBERFILES += $(LIBS)
$(PICS) $(PICS2) $(PICS3) := CPPFLAGS += -DPIC -D_REENTRANT
$(PICS) $(PICS2) $(PICS3) := sparc_CFLAGS += -xregs=no%appl $(sparc_C_PICFLAGS)
$(PICS) $(PICS2) $(PICS3) := sparcv9_CFLAGS += -xregs=no%appl $(sparcv9_C_PICFLAGS)
$(PICS) $(PICS2) $(PICS3) := i386_CFLAGS += $(i386_C_PICFLAGS)
$(PICS) $(PICS2) $(PICS3) := amd64_CFLAGS += $(amd64_C_PICFLAGS)
pics objs:
-@mkdir -p $@
pics/%.o: %.c
$(COMPILE$(BT:32=).c) -o $@ $<
$(PROG) $(SBINPROG): $(OBJS)
$(LINK$(BT:32=).c) -o $@ $(OBJS) $(BDIRECT) $(LDLIBS)
$(KMODULE): $(KOBJS)
$(LD) -r $(KLDFLAGS) -o $@ $(KOBJS)
$(CTFMERGE) $(CTFMRGFLAGS) -o $@ $(KOBJS)
$(LIBS): pics $(PICS) $(PICS2) .WAIT
$(CC) -o $@ $(GSHARED) -h $(SONAME) $(DYNFLAGS) $(PICS) $(LDFLAGS)
#.PRECIOUS: $(LIBS)
# kernel modul related convinience targets
no_ontools:
ontools:
@SPRO_CC=$$( whence cc || true ) ; \
) ; \
ONCC=$$(if [ -x ${K_CC} -a -n "$$SPRO_ROOT" ]; then \
echo "CC = export SPRO_VROOT=\$$(SPRO_VROOT) ; \$$(K_CC) -_cc" ; \
echo "ENVCPPFLAGS1 += \$$(STAND_FLAGS_GCC\$$(BT))" ; \
echo "CTFMERGE = \$$(K_CTFMERGE)" ; \
echo "CTFCONVERT = \$$(K_CTFCONVERT)" ; \
else \
fi || true \
) ; \
echo "\n\
# onbld tools\n\
$$SPRO_ROOT\n\
$$ONCC\n\
#\n\
" >$(MAKECONFIG)