Retire the '@' symlink. It isn't really needed and causes more

problems than it solves. SYSDIR is already defined almost always and
can be used instead. Working around the one case where it isn't is
much easier than working around the fact that @ may not exist in 18
other places.

Differential Revision: https://reviews.freebsd.org/D1100
This commit is contained in:
Warner Losh 2014-11-06 16:48:37 +00:00
parent 16b02a8fc8
commit 528013d5a8
5 changed files with 43 additions and 105 deletions

View File

@ -99,11 +99,11 @@ CFLAGS+= -DHAVE_KERNEL_OPTION_HEADERS -include ${KERNBUILDDIR}/opt_global.h
# Add -I paths for system headers. Individual module makefiles don't
# need any -I paths for this. Similar defaults for .PATH can't be
# set because there are no standard paths for non-headers.
CFLAGS+= -I. -I@
CFLAGS+= -I. -I${SYSDIR}
# Add -I path for altq headers as they are included via net/if_var.h
# for example.
CFLAGS+= -I@/contrib/altq
CFLAGS+= -I${SYSDIR}/contrib/altq
CFLAGS.gcc+= -finline-limit=${INLINE_LIMIT}
CFLAGS.gcc+= --param inline-unit-growth=100
@ -132,12 +132,8 @@ CTFFLAGS+= -g
.endif
.if defined(FIRMWS)
.if !exists(@)
${KMOD:S/$/.c/}: @
.else
${KMOD:S/$/.c/}: @/tools/fw_stub.awk
.endif
${AWK} -f @/tools/fw_stub.awk ${FIRMWS} -m${KMOD} -c${KMOD:S/$/.c/g} \
${KMOD:S/$/.c/}: ${SYSDIR}/tools/fw_stub.awk
${AWK} -f ${SYSDIR}/tools/fw_stub.awk ${FIRMWS} -m${KMOD} -c${KMOD:S/$/.c/g} \
${FIRMWARE_LICENSE:C/.+/-l/}${FIRMWARE_LICENSE}
SRCS+= ${KMOD:S/$/.c/}
@ -216,7 +212,7 @@ ${FULLPROG}: ${OBJS}
${OBJCOPY} --strip-debug ${.TARGET}
.endif
_ILINKS=@ machine
_ILINKS=machine
.if ${MACHINE} != ${MACHINE_CPUARCH}
_ILINKS+=${MACHINE_CPUARCH}
.endif
@ -255,8 +251,6 @@ ${.OBJDIR}/${_link}:
@case ${.TARGET:T} in \
machine) \
path=${SYSDIR}/${MACHINE}/include ;; \
@) \
path=${SYSDIR} ;; \
*) \
path=${SYSDIR}/${.TARGET:T}/include ;; \
esac ; \
@ -390,12 +384,8 @@ MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \
.for _src in ${SRCS:M${_srcsrc:T:R}.${_ext}}
CLEANFILES+= ${_src}
.if !target(${_src})
.if !exists(@)
${_src}: @
.else
${_src}: @/tools/makeobjops.awk @/${_srcsrc}
.endif
${AWK} -f @/tools/makeobjops.awk @/${_srcsrc} -${_ext}
${_src}: ${SYSDIR}/tools/makeobjops.awk ${SYSDIR}/${_srcsrc}
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${SYSDIR}/${_srcsrc} -${_ext}
.endif
.endfor # _src
.endfor # _ext
@ -403,70 +393,46 @@ ${_src}: @/tools/makeobjops.awk @/${_srcsrc}
.if !empty(SRCS:Mvnode_if.c)
CLEANFILES+= vnode_if.c
.if !exists(@)
vnode_if.c: @
.else
vnode_if.c: @/tools/vnode_if.awk @/kern/vnode_if.src
.endif
${AWK} -f @/tools/vnode_if.awk @/kern/vnode_if.src -c
vnode_if.c: ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src
${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -c
.endif
.if !empty(SRCS:Mvnode_if.h)
CLEANFILES+= vnode_if.h vnode_if_newproto.h vnode_if_typedef.h
.if !exists(@)
vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: @
.else
vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: @/tools/vnode_if.awk \
@/kern/vnode_if.src
.endif
vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: ${SYSDIR}/tools/vnode_if.awk \
${SYSDIR}/kern/vnode_if.src
vnode_if.h: vnode_if_newproto.h vnode_if_typedef.h
${AWK} -f @/tools/vnode_if.awk @/kern/vnode_if.src -h
${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -h
vnode_if_newproto.h:
${AWK} -f @/tools/vnode_if.awk @/kern/vnode_if.src -p
${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -p
vnode_if_typedef.h:
${AWK} -f @/tools/vnode_if.awk @/kern/vnode_if.src -q
${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -q
.endif
.for _i in mii pccard
.if !empty(SRCS:M${_i}devs.h)
CLEANFILES+= ${_i}devs.h
.if !exists(@)
${_i}devs.h: @
.else
${_i}devs.h: @/tools/${_i}devs2h.awk @/dev/${_i}/${_i}devs
.endif
${AWK} -f @/tools/${_i}devs2h.awk @/dev/${_i}/${_i}devs
${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs
${AWK} -f ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs
.endif
.endfor # _i
.if !empty(SRCS:Musbdevs.h)
CLEANFILES+= usbdevs.h
.if !exists(@)
usbdevs.h: @
.else
usbdevs.h: @/tools/usbdevs2h.awk @/dev/usb/usbdevs
.endif
${AWK} -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -h
usbdevs.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs
${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -h
.endif
.if !empty(SRCS:Musbdevs_data.h)
CLEANFILES+= usbdevs_data.h
.if !exists(@)
usbdevs_data.h: @
.else
usbdevs_data.h: @/tools/usbdevs2h.awk @/dev/usb/usbdevs
.endif
${AWK} -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -d
usbdevs_data.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs
${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -d
.endif
.if !empty(SRCS:Macpi_quirks.h)
CLEANFILES+= acpi_quirks.h
.if !exists(@)
acpi_quirks.h: @
.else
acpi_quirks.h: @/tools/acpi_quirks2h.awk @/dev/acpica/acpi_quirks
.endif
${AWK} -f @/tools/acpi_quirks2h.awk @/dev/acpica/acpi_quirks
acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks
${AWK} -f ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks
.endif
.if !empty(SRCS:Massym.s)
@ -475,18 +441,12 @@ assym.s: genassym.o
.if defined(KERNBUILDDIR)
genassym.o: opt_global.h
.endif
.if !exists(@)
assym.s:
.else
assym.s: @/kern/genassym.sh
.endif
sh @/kern/genassym.sh genassym.o > ${.TARGET}
.if exists(@)
genassym.o: @/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c
.endif
assym.s: ${SYSDIR}/kern/genassym.sh
sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET}
genassym.o: ${SYSDIR}/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c
genassym.o: ${SRCS:Mopt_*.h}
${CC} -c ${CFLAGS:N-fno-common} \
@/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c
${SYSDIR}/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c
.endif
lint: ${SRCS}

View File

@ -40,10 +40,7 @@ EXPORT_SYMS+= linux_ioctl_unregister_handler
CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o
linux${SFX}_assym.h: linux${SFX}_genassym.o
.if exists(@)
linux${SFX}_assym.h: @/kern/genassym.sh
.endif
sh @/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
sh ${SYSDIR}/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
linux${SFX}_locore.o: linux${SFX}_assym.h assym.s
${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \

View File

@ -1,9 +1,11 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../../dev/sound
.PATH: ${.CURDIR}/../../../dev/sound/pcm
.PATH: ${.CURDIR}/../../../dev/sound/midi
.PATH: ${.CURDIR}/../../../dev/sound/isa
SYSDIR?=${.CURDIR}/../../..
.PATH: ${SYSDIR}/dev/sound
.PATH: ${SYSDIR}/dev/sound/pcm
.PATH: ${SYSDIR}/dev/sound/midi
.PATH: ${SYSDIR}/dev/sound/isa
KMOD= sound
SRCS= device_if.h bus_if.h isa_if.h pci_if.h opt_isa.h
@ -19,26 +21,14 @@ SRCS+= ac97.c ac97_patch.c buffer.c channel.c clone.c dsp.c
SRCS+= mixer.c sndstat.c sound.c unit.c vchan.c
SRCS+= midi.c mpu401.c sequencer.c
.if !exists(@)
feeder_eq_gen.h: @
.else
feeder_eq_gen.h: @/tools/sound/feeder_eq_mkfilter.awk
.endif
${AWK} -f @/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET}
feeder_eq_gen.h: ${SYSDIR}/tools/sound/feeder_eq_mkfilter.awk
${AWK} -f ${SYSDIR}/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET}
.if !exists(@)
feeder_rate_gen.h: @
.else
feeder_rate_gen.h: @/tools/sound/feeder_rate_mkfilter.awk
.endif
${AWK} -f @/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET}
feeder_rate_gen.h: ${SYSDIR}/tools/sound/feeder_rate_mkfilter.awk
${AWK} -f ${SYSDIR}/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET}
.if !exists(@)
snd_fxdiv_gen.h: @
.else
snd_fxdiv_gen.h: @/tools/sound/snd_fxdiv_gen.awk
.endif
${AWK} -f @/tools/sound/snd_fxdiv_gen.awk -- > ${.TARGET}
snd_fxdiv_gen.h: ${SYSDIR}/tools/sound/snd_fxdiv_gen.awk
${AWK} -f ${SYSDIR}/tools/sound/snd_fxdiv_gen.awk -- > ${.TARGET}
CLEANFILES+= feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h

View File

@ -14,16 +14,13 @@ SRCS+= opt_ktrace.h opt_sysvipc.h
CLEANFILES= svr4_assym.h svr4_genassym.o
svr4_assym.h: svr4_genassym.o
.if exists(@)
svr4_assym.h: @/kern/genassym.sh
.endif
sh @/kern/genassym.sh svr4_genassym.o > ${.TARGET}
sh ${SYSDIR}/kern/genassym.sh svr4_genassym.o > ${.TARGET}
svr4_locore.o: svr4_locore.s svr4_assym.h
${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
${.IMPSRC} -o ${.TARGET}
svr4_genassym.o: svr4_genassym.c svr4.h @ machine
svr4_genassym.o: svr4_genassym.c svr4.h
${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
.if !defined(KERNBUILDDIR) && defined(DEBUG)

View File

@ -58,16 +58,10 @@ SRCS+= vmcb.c \
CLEANFILES= vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o
vmx_assym.h: vmx_genassym.o
.if exists(@)
vmx_assym.h: @/kern/genassym.sh
.endif
sh @/kern/genassym.sh vmx_genassym.o > ${.TARGET}
sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET}
svm_assym.h: svm_genassym.o
.if exists(@)
svm_assym.h: @/kern/genassym.sh
.endif
sh @/kern/genassym.sh svm_genassym.o > ${.TARGET}
sh ${SYSDIR}/kern/genassym.sh svm_genassym.o > ${.TARGET}
vmx_support.o:
${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \