Tidy up makefiles.

Tested by:	marcel
This commit is contained in:
Ruslan Ermilov 2004-02-12 08:10:34 +00:00
parent aa0b7126ba
commit 5c8f32a869
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125729
8 changed files with 74 additions and 264 deletions

View File

@ -1,4 +1,7 @@
# $FreeBSD$
BINDIR?= /boot
# Options used when building app-specific efi components
CFLAGS+= -ffreestanding -fshort-wchar -Wformat
LDFLAGS+= -nostdlib

View File

@ -12,28 +12,21 @@ SRCS+= delay.c efifs.c efinet.c elf_freebsd.c bootinfo.c pal.S
SRCS+= efifpswa.c
.endif
CFLAGS+= -ffreestanding -fpic
CFLAGS+= -fpic
CFLAGS+= -I${.CURDIR}/../include
CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${.CURDIR}/../../common
.if ${MACHINE_ARCH} == "powerpc"
CFLAGS+= -msoft-float
.endif
.ifdef(BOOT_DISK_DEBUG)
.if defined(BOOT_DISK_DEBUG)
# Make the disk code more talkative
CFLAGS+= -DDISK_DEBUG
.endif
machine:
ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
CLEANFILES+= machine
.include <bsd.lib.mk>
beforedepend ${OBJS}: machine

View File

@ -1,76 +1,45 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../common
BASE= loader
PROG= ${BASE}.efi
PROG= loader.sym
INTERNALPROG=
NOMAN=
NEWVERSWHAT= "EFI boot" ${MACHINE_ARCH}
BINDIR?= /boot
STRIP= # We must not strip loader.efi at install time.
SRCS+= main.c conf.c dev_net.c
SRCS= start.S main.c conf.c dev_net.c vers.c
CFLAGS+= -ffreestanding
.PATH: ${.CURDIR}/../libefi/arch/${MACHINE_ARCH}
.if !defined(NOFORTH)
# Enable BootForth
BOOT_FORTH= yes
CFLAGS+= -DBOOT_FORTH
CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/${MACHINE_ARCH}
.if exists(${.OBJDIR}/../../ficl/libficl.a)
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
.else
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
.endif
.endif
# where to get libstand from
.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a)
LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
.else
LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
.endif
.if exists(${.OBJDIR}/../libefi/libefi.a)
LIBEFI= ${.OBJDIR}/../libefi/libefi.a
.else
LIBEFI= ${.CURDIR}/../libefi/libefi.a
.endif
# Always add MI sources
.PATH: ${.CURDIR}/../../common
.include <${.CURDIR}/../../common/Makefile.inc>
.include "${.CURDIR}/../../common/Makefile.inc"
CFLAGS+= -I-
CFLAGS+= -I${.CURDIR}/../include
CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../libefi
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
CFLAGS+= -DLOADER
LDSCRIPT= ${.CURDIR}/../libefi/arch/${MACHINE_ARCH}/ldscript.${MACHINE_ARCH}
LDFLAGS= -nostdlib -T ${LDSCRIPT} -shared -Bsymbolic
LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-M,-Map,loader.list -shared -symbolic
OBJCOPY?= objcopy
CLEANFILES+= setdef0.c setdef0.o setdef1.c setdef1.o setdefs.h start.o \
vers.c vers.o ${BASE}.efi ${BASE}.sym ${BASE}.list
CLEANFILES+= loader.help
CLEANFILES+= machine
CLEANFILES= vers.c loader.efi loader.list loader.help
CRT= start.o
all: ${BASE}
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
${BASE}: ${BASE}.efi ${BASE}.help
${BASE}.efi: ${BASE}.sym
loader.efi: loader.sym
${OBJCOPY} -j .text \
-j .hash \
-j .data \
@ -81,43 +50,22 @@ ${BASE}.efi: ${BASE}.sym
-j .dynsym \
-j .dynstr \
--target=efi-app-${MACHINE_ARCH} \
${BASE}.sym ${BASE}.efi
loader.sym loader.efi
${BASE}.help: help.common
loader.help: help.common
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
> ${.TARGET}
beforeinstall:
.if exists(${.OBJDIR}/loader.help)
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
.else
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/${BASE}.help ${DESTDIR}/boot
.endif
.PATH: ${.CURDIR}/../../forth
FILES= loader.efi loader.help loader.4th support.4th loader.conf
FILESMODE_loader.efi= ${BINMODE}
FILESDIR_loader.conf= /boot/defaults
.if !exists(${DESTDIR}/boot/loader.rc)
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
FILES+= loader.rc
.endif
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults
# Other fragments still to be brought in from ../Makfile.booters?
start.o: ${.CURDIR}/../libefi/arch/${MACHINE_ARCH}/start.S
${CC} -c ${CFLAGS} ${.IMPSRC}
machine:
ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND}
LDADD= ${LIBFICL} ${LIBEFI} -lstand
.include <bsd.prog.mk>
${BASE}.sym: ${OBJS} ${LIBFICL} ${LIBEFI} ${LIBSTAND} ${CRT} vers.o
${LD} ${LDFLAGS} -o ${BASE}.sym -M ${CRT} ${OBJS} vers.o \
${LIBFICL} ${LIBEFI} ${LIBSTAND} > ${.OBJDIR}/${BASE}.list
beforedepend ${OBJS}: machine

View File

@ -1,4 +1,7 @@
# $FreeBSD$
BINDIR?= /boot
# Options used when building standalone components
CFLAGS+= -ffreestanding -fshort-wchar -Wformat
LDFLAGS+= -nostdlib

View File

@ -1,76 +1,45 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../common
BASE= loader
PROG= ${BASE}.efi
PROG= loader.sym
INTERNALPROG=
NOMAN=
NEWVERSWHAT= "EFI boot" ${MACHINE_ARCH}
BINDIR?= /boot
STRIP= # We must not strip loader.efi at install time.
SRCS+= main.c conf.c dev_net.c
SRCS= start.S main.c conf.c dev_net.c vers.c
CFLAGS+= -ffreestanding
.PATH: ${.CURDIR}/../libefi/arch/${MACHINE_ARCH}
.if !defined(NOFORTH)
# Enable BootForth
BOOT_FORTH= yes
CFLAGS+= -DBOOT_FORTH
CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/${MACHINE_ARCH}
.if exists(${.OBJDIR}/../../ficl/libficl.a)
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
.else
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
.endif
.endif
# where to get libstand from
.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a)
LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
.else
LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
.endif
.if exists(${.OBJDIR}/../libefi/libefi.a)
LIBEFI= ${.OBJDIR}/../libefi/libefi.a
.else
LIBEFI= ${.CURDIR}/../libefi/libefi.a
.endif
# Always add MI sources
.PATH: ${.CURDIR}/../../common
.include <${.CURDIR}/../../common/Makefile.inc>
.include "${.CURDIR}/../../common/Makefile.inc"
CFLAGS+= -I-
CFLAGS+= -I${.CURDIR}/../include
CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../libefi
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
CFLAGS+= -DLOADER
LDSCRIPT= ${.CURDIR}/../libefi/arch/${MACHINE_ARCH}/ldscript.${MACHINE_ARCH}
LDFLAGS= -nostdlib -T ${LDSCRIPT} -shared -Bsymbolic
LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-M,-Map,loader.list -shared -symbolic
OBJCOPY?= objcopy
CLEANFILES+= setdef0.c setdef0.o setdef1.c setdef1.o setdefs.h start.o \
vers.c vers.o ${BASE}.efi ${BASE}.sym ${BASE}.list
CLEANFILES+= loader.help
CLEANFILES+= machine
CLEANFILES= vers.c loader.efi loader.list loader.help
CRT= start.o
all: ${BASE}
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
${BASE}: ${BASE}.efi ${BASE}.help
${BASE}.efi: ${BASE}.sym
loader.efi: loader.sym
${OBJCOPY} -j .text \
-j .hash \
-j .data \
@ -81,43 +50,22 @@ ${BASE}.efi: ${BASE}.sym
-j .dynsym \
-j .dynstr \
--target=efi-app-${MACHINE_ARCH} \
${BASE}.sym ${BASE}.efi
loader.sym loader.efi
${BASE}.help: help.common
loader.help: help.common
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
> ${.TARGET}
beforeinstall:
.if exists(${.OBJDIR}/loader.help)
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
.else
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/${BASE}.help ${DESTDIR}/boot
.endif
.PATH: ${.CURDIR}/../../forth
FILES= loader.efi loader.help loader.4th support.4th loader.conf
FILESMODE_loader.efi= ${BINMODE}
FILESDIR_loader.conf= /boot/defaults
.if !exists(${DESTDIR}/boot/loader.rc)
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
FILES+= loader.rc
.endif
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults
# Other fragments still to be brought in from ../Makfile.booters?
start.o: ${.CURDIR}/../libefi/arch/${MACHINE_ARCH}/start.S
${CC} -c ${CFLAGS} ${.IMPSRC}
machine:
ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND}
LDADD= ${LIBFICL} ${LIBEFI} -lstand
.include <bsd.prog.mk>
${BASE}.sym: ${OBJS} ${LIBFICL} ${LIBEFI} ${LIBSTAND} ${CRT} vers.o
${LD} ${LDFLAGS} -o ${BASE}.sym -M ${CRT} ${OBJS} vers.o \
${LIBFICL} ${LIBEFI} ${LIBSTAND} > ${.OBJDIR}/${BASE}.list
beforedepend ${OBJS}: machine

View File

@ -7,30 +7,21 @@ SRCS= skiconsole.c time.c copy.c devicename.c module.c exit.c
SRCS+= delay.c skifs.c elf_freebsd.c bootinfo.c ssc.c
SRCS+= acpi_stub.c efi_stub.c pal_stub.S sal_stub.c
CFLAGS+= -ffreestanding -fpic -g
CFLAGS+= -I${.CURDIR}/../include
CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
CFLAGS+= -fpic
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
CFLAGS+= -I${.CURDIR}/../../efi/include
CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_ARCH}
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../..
.if ${MACHINE_ARCH} == "powerpc"
CFLAGS+= -msoft-float
.endif
.ifdef(BOOT_DISK_DEBUG)
.if defined(BOOT_DISK_DEBUG)
# Make the disk code more talkative
CFLAGS+= -DDISK_DEBUG
.endif
machine:
ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
CLEANFILES+= machine
.include <bsd.lib.mk>
beforedepend ${OBJS}: machine

View File

@ -8,78 +8,40 @@ NEWVERSWHAT= "ia64 SKI boot" ${MACHINE_ARCH}
BINDIR?= /boot
STRIP= # We must not strip skiload at install time.
SRCS+= conf.c main.c start.S
CFLAGS+= -ffreestanding
SRCS= conf.c main.c start.S vers.c
.if !defined(NOFORTH)
# Enable BootForth
BOOT_FORTH= yes
CFLAGS+= -DBOOT_FORTH
CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/${MACHINE_ARCH}
.if exists(${.OBJDIR}/../../ficl/libficl.a)
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
.else
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
.endif
.endif
# where to get libstand from
.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a)
LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
.else
LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
.endif
.if exists(${.OBJDIR}/../libski/libski.a)
LIBSKI= ${.OBJDIR}/../libski/libski.a
.else
LIBSKI= ${.CURDIR}/../libski/libski.a
.endif
# Always add MI sources
.PATH: ${.CURDIR}/../../common
.include <${.CURDIR}/../../common/Makefile.inc>
.include "${.CURDIR}/../../common/Makefile.inc"
CFLAGS+= -I-
CFLAGS+= -I${.CURDIR}/../include
CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../libski
CFLAGS+= -DLOADER
LDFLAGS= -nostdlib -T ${.CURDIR}/ldscript.ia64
LDFLAGS= -Wl,-T${.CURDIR}/ldscript.ia64 -Wl,-M,-Map,${PROG}.list
CLEANFILES+= vers.c vers.o ${PROG}.list
CLEANFILES+= loader.help
CLEANFILES+= machine
CLEANFILES= vers.c ${PROG}.list ${PROG}.help
all: ${PROG}
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
${PROG}.help: help.common help.efi
${PROG}.help: help.common
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
> ${.TARGET}
beforeinstall:
.if exists(${.OBJDIR}/${PROG}.help)
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.OBJDIR}/${PROG}.help ${DESTDIR}/boot
.endif
FILES= ${PROG}.help
machine:
ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
${PROG}: ${OBJS} ${LIBFICL} ${LIBSKI} ${LIBSTAND} vers.o
${LD} ${LDFLAGS} -o ${PROG} -M \
${OBJS} vers.o \
${LIBFICL} ${LIBSTAND} ${LIBSKI} ${LIBSTAND} \
> ${.OBJDIR}/${PROG}.list
DPADD= ${LIBFICL} ${LIBSKI} ${LIBSTAND}
LDADD= ${LIBFICL} ${LIBSKI} -lstand
.include <bsd.prog.mk>
beforedepend ${OBJS}: machine

View File

@ -8,78 +8,40 @@ NEWVERSWHAT= "ia64 SKI boot" ${MACHINE_ARCH}
BINDIR?= /boot
STRIP= # We must not strip skiload at install time.
SRCS+= conf.c main.c start.S
CFLAGS+= -ffreestanding
SRCS= conf.c main.c start.S vers.c
.if !defined(NOFORTH)
# Enable BootForth
BOOT_FORTH= yes
CFLAGS+= -DBOOT_FORTH
CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/${MACHINE_ARCH}
.if exists(${.OBJDIR}/../../ficl/libficl.a)
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
.else
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
.endif
.endif
# where to get libstand from
.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a)
LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
.else
LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
.endif
.if exists(${.OBJDIR}/../libski/libski.a)
LIBSKI= ${.OBJDIR}/../libski/libski.a
.else
LIBSKI= ${.CURDIR}/../libski/libski.a
.endif
# Always add MI sources
.PATH: ${.CURDIR}/../../common
.include <${.CURDIR}/../../common/Makefile.inc>
.include "${.CURDIR}/../../common/Makefile.inc"
CFLAGS+= -I-
CFLAGS+= -I${.CURDIR}/../include
CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../libski
CFLAGS+= -DLOADER
LDFLAGS= -nostdlib -T ${.CURDIR}/ldscript.ia64
LDFLAGS= -Wl,-T${.CURDIR}/ldscript.ia64 -Wl,-M,-Map,${PROG}.list
CLEANFILES+= vers.c vers.o ${PROG}.list
CLEANFILES+= loader.help
CLEANFILES+= machine
CLEANFILES= vers.c ${PROG}.list ${PROG}.help
all: ${PROG}
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
${PROG}.help: help.common help.efi
${PROG}.help: help.common
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
> ${.TARGET}
beforeinstall:
.if exists(${.OBJDIR}/${PROG}.help)
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.OBJDIR}/${PROG}.help ${DESTDIR}/boot
.endif
FILES= ${PROG}.help
machine:
ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
${PROG}: ${OBJS} ${LIBFICL} ${LIBSKI} ${LIBSTAND} vers.o
${LD} ${LDFLAGS} -o ${PROG} -M \
${OBJS} vers.o \
${LIBFICL} ${LIBSTAND} ${LIBSKI} ${LIBSTAND} \
> ${.OBJDIR}/${PROG}.list
DPADD= ${LIBFICL} ${LIBSKI} ${LIBSTAND}
LDADD= ${LIBFICL} ${LIBSKI} -lstand
.include <bsd.prog.mk>
beforedepend ${OBJS}: machine