summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2013-01-17 12:25:12 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2013-01-17 12:25:12 +0000
commitfe6266fbe52c726e1378d5573d252e068683681f (patch)
tree660375da411fedb6903b4685fb624610565a682d /sys/arch/amd64
parent30179cf655de82f7ba463b6515ef59f92690d21a (diff)
Clean up/standardise makefiles for amd64/stand.
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/stand/biosboot/Makefile11
-rw-r--r--sys/arch/amd64/stand/boot/Makefile37
-rw-r--r--sys/arch/amd64/stand/cdboot/Makefile16
-rw-r--r--sys/arch/amd64/stand/cdbr/Makefile11
-rw-r--r--sys/arch/amd64/stand/mbr/Makefile11
-rw-r--r--sys/arch/amd64/stand/pxeboot/Makefile6
6 files changed, 43 insertions, 49 deletions
diff --git a/sys/arch/amd64/stand/biosboot/Makefile b/sys/arch/amd64/stand/biosboot/Makefile
index 6c88c12e65d..069526e3e7d 100644
--- a/sys/arch/amd64/stand/biosboot/Makefile
+++ b/sys/arch/amd64/stand/biosboot/Makefile
@@ -1,19 +1,21 @@
-# $OpenBSD: Makefile,v 1.6 2012/09/25 09:01:03 pascal Exp $
+# $OpenBSD: Makefile,v 1.7 2013/01/17 12:25:11 jsing Exp $
MAN= biosboot.8
.if ${MACHINE} == "amd64"
+S= ${.CURDIR}/../../../..
+SADIR= ${.CURDIR}/..
+
PROG= biosboot
SRCS= biosboot.S
LD=ld
LDFLAGS=-nostdlib -Ttext 0 -N -x -Bstatic -nopie
LDFLAGS+=-melf_i386 -L/usr/libdata
INSTALL_STRIP=
-SADIR= ${.CURDIR}/..
-${PROG}: $(OBJS) $(DPADD)
+${PROG}: $(OBJS)
@rm -f $(PROG)
- $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LDADD)
+ $(LD) $(LDFLAGS) -o $(PROG) $(OBJS)
@size $(PROG)
CPPFLAGS+=-DLOADADDR=$(LOADADDR) -DLINKADDR=$(LINKADDR) -DBOOTMAGIC=$(BOOTMAGIC)
@@ -26,4 +28,3 @@ NOPROG=
.endif
.include <bsd.prog.mk>
-
diff --git a/sys/arch/amd64/stand/boot/Makefile b/sys/arch/amd64/stand/boot/Makefile
index 2705ea74217..557fd32a67b 100644
--- a/sys/arch/amd64/stand/boot/Makefile
+++ b/sys/arch/amd64/stand/boot/Makefile
@@ -1,15 +1,15 @@
-# $OpenBSD: Makefile,v 1.17 2012/10/27 15:43:42 jsing Exp $
-
-.include "${.CURDIR}/../Makefile.inc"
+# $OpenBSD: Makefile,v 1.18 2013/01/17 12:25:11 jsing Exp $
MAN?= boot.8
MLINKS?=boot.8 boot.conf.5
.if ${MACHINE} == "amd64"
-S =${.CURDIR}/../../../..
+S= ${.CURDIR}/../../../..
SADIR= ${.CURDIR}/..
-.if empty(CFLAGS:M-DFDBOOT)
+.if !empty(CFLAGS:M-DFDBOOT)
+SOFTRAID=no
+.else
SOFTRAID=yes
.endif
@@ -21,26 +21,25 @@ LDFLAGS+=-nostdlib -Bstatic -Ttext $(LINKADDR) -N -x -nopie
LDFLAGS+=-melf_i386 -L/usr/libdata
.PATH: ${SADIR}/libsa
-# i386 stuff (so, it will possibly load in the same 64k)
-SRCS+= machdep.c dev_i386.c exec_i386.c cmd_i386.c
-SRCS+= gidt.S alloca.S biosdev.c bioscons.c gateA20.c \
- memprobe.c diskprobe.c time.c ## biosprobe.c
-.if defined(SOFTRAID)
+SRCS+= alloca.S gidt.S
+SRCS+= cmd_i386.c dev_i386.c exec_i386.c gateA20.c machdep.c
+SRCS+= bioscons.c biosdev.c diskprobe.c memprobe.c time.c
+.if ${SOFTRAID:L} == "yes"
SRCS+= softraid.c
.endif
.PATH: ${S}/stand/boot
-SRCS+= boot.c cmd.c vars.c bootarg.c
+SRCS+= boot.c bootarg.c cmd.c vars.c
.PATH: ${S}/lib/libsa
-SRCS+= alloc.c exit.c getfile.c gets.c globals.c strcmp.c strlen.c \
- strncmp.c memcmp.c memcpy.c memset.c printf.c snprintf.c \
- strerror.c strncpy.c strtol.c strtoll.c ctime.c strlcpy.c strlcat.c
-SRCS+= close.c closeall.c dev.c disklabel.c dkcksum.c fstat.c ioctl.c lseek.c \
- open.c read.c stat.c write.c cread.c readdir.c cons.c loadfile.c \
- elf32.c elf64.c
+SRCS+= alloc.c ctime.c exit.c getfile.c gets.c globals.c memcmp.c memcpy.c \
+ memset.c printf.c snprintf.c strcmp.c strerror.c strlcat.c strlcpy.c \
+ strlen.c strncmp.c strncpy.c strtol.c strtoll.c
+SRCS+= close.c closeall.c cons.c cread.c dev.c disklabel.c dkcksum.c fstat.c \
+ ioctl.c lseek.c open.c read.c readdir.c stat.c write.c
+SRCS+= elf32.c elf64.c loadfile.c
SRCS+= ufs.c
-.if defined(SOFTRAID)
+.if ${SOFTRAID:L} == "yes"
SRCS+= aes_xts.c explicit_bzero.c hmac_sha1.c pbkdf2.c rijndael.c sha1.c
.endif
@@ -67,7 +66,7 @@ NOPROG=
.include <bsd.prog.mk>
-.if defined(SOFTRAID)
+.if ${SOFTRAID:L} == "yes"
CPPFLAGS+=-DSOFTRAID
.endif
CPPFLAGS+=-DBOOTMAGIC=$(BOOTMAGIC) ${DEBUGFLAGS} -DLINKADDR=${LINKADDR}
diff --git a/sys/arch/amd64/stand/cdboot/Makefile b/sys/arch/amd64/stand/cdboot/Makefile
index a598a725903..a203aad1581 100644
--- a/sys/arch/amd64/stand/cdboot/Makefile
+++ b/sys/arch/amd64/stand/cdboot/Makefile
@@ -1,11 +1,9 @@
-# $OpenBSD: Makefile,v 1.16 2012/10/29 13:56:25 jsing Exp $
-
-.include "${.CURDIR}/../Makefile.inc"
+# $OpenBSD: Makefile,v 1.17 2013/01/17 12:25:11 jsing Exp $
MAN= cdboot.8
.if ${MACHINE} == "amd64"
-S =${.CURDIR}/../../../..
+S= ${.CURDIR}/../../../..
SADIR= ${.CURDIR}/..
PROG= cdboot
@@ -17,10 +15,9 @@ LDFLAGS+=-melf_i386 -L/usr/libdata
INSTALL_STRIP=
.PATH: ${SADIR}/libsa
-# i386 stuff (so, it will possibly load in the same 64k)
SRCS+= machdep.c dev_i386.c exec_i386.c cmd_i386.c
SRCS+= gidt.S alloca.S biosdev.c bioscons.c gateA20.c \
- memprobe.c diskprobe.c time.c ## biosprobe.c
+ memprobe.c diskprobe.c time.c
SRCS+= softraid.c
.PATH: ${S}/stand/boot
@@ -42,11 +39,8 @@ SRCS+= divdi3.c moddi3.c qdivrem.c
.PATH: ${S}/lib/libz
SRCS+= adler32.c crc32.c inflate.c inftrees.c
-#LDADD= ${LIBSA} ${LIBZ}
-#DPADD= ${LIBSA} ${LIBZ}
-
-${PROG}: $(OBJS) $(DPADD)
- $(LD) $(LDFLAGS) -o ${PROG} $(OBJS) $(LDADD)
+${PROG}: $(OBJS)
+ $(LD) $(LDFLAGS) -o ${PROG} $(OBJS)
@$(SIZE) $(PROG)
@if [ -x ${.OBJDIR}/${PROG} ]; then \
objcopy -O binary ${PROG} ${.OBJDIR}/.tmp;\
diff --git a/sys/arch/amd64/stand/cdbr/Makefile b/sys/arch/amd64/stand/cdbr/Makefile
index 4027d67bf58..da1e5eec531 100644
--- a/sys/arch/amd64/stand/cdbr/Makefile
+++ b/sys/arch/amd64/stand/cdbr/Makefile
@@ -1,6 +1,9 @@
-# $OpenBSD: Makefile,v 1.6 2012/09/25 09:01:03 pascal Exp $
+# $OpenBSD: Makefile,v 1.7 2013/01/17 12:25:11 jsing Exp $
#
+S= ${.CURDIR}/../../../..
+SADIR= ${.CURDIR}/..
+
PROG= cdbr
SRCS= cdbr.S
AFLAGS+=-m32
@@ -12,18 +15,16 @@ LD=ld
ORG= 0x0000
LDFLAGS=-nostdlib -Ttext ${ORG} -x -N -s -Bstatic -e start -nopie
LDFLAGS+=-melf_i386 -L/usr/libdata
+INSTALL_STRIP=
NOMAN=
#MAN+= cdbr.8
-INSTALL_STRIP=
-SADIR=${.CURDIR}/..
-S= ${.CURDIR}/../../../..
-
${PROG}: $(OBJS) $(DPADD)
$(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LDADD)
@size $(PROG)
@if [ -x ${.OBJDIR}/${PROG} ]; then \
+ cp ${PROG} ${PROG}.orig; \
objcopy -O binary ${PROG} ${.OBJDIR}/.tmp;\
mv -f ${.OBJDIR}/.tmp ${.OBJDIR}/${PROG}; \
ls -l ${.OBJDIR}/${PROG}; \
diff --git a/sys/arch/amd64/stand/mbr/Makefile b/sys/arch/amd64/stand/mbr/Makefile
index 5a16064c8ff..d1bf020173e 100644
--- a/sys/arch/amd64/stand/mbr/Makefile
+++ b/sys/arch/amd64/stand/mbr/Makefile
@@ -1,6 +1,9 @@
-# $OpenBSD: Makefile,v 1.6 2012/09/25 09:01:03 pascal Exp $
+# $OpenBSD: Makefile,v 1.7 2013/01/17 12:25:11 jsing Exp $
#
+S= ${.CURDIR}/../../../..
+SADIR= ${.CURDIR}/..
+
PROG= mbr
SRCS= mbr.S
AFLAGS+=-m32
@@ -14,14 +17,12 @@ NOMAN=
#MAN+= mbr.8
INSTALL_STRIP=
-SADIR=${.CURDIR}/..
-S= ${.CURDIR}/../../../..
# Uncomment this to make mbr talk to a serial port.
#CPPFLAGS+=-DSERIAL=0
-${PROG}: $(OBJS) $(DPADD)
- $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LDADD)
+${PROG}: $(OBJS)
+ $(LD) $(LDFLAGS) -o $(PROG) $(OBJS)
@size $(PROG)
@if [ -x ${.OBJDIR}/${PROG} ]; then \
objcopy -O binary ${PROG} ${.OBJDIR}/.tmp;\
diff --git a/sys/arch/amd64/stand/pxeboot/Makefile b/sys/arch/amd64/stand/pxeboot/Makefile
index a6bf6f15c0e..d6ba0b7524f 100644
--- a/sys/arch/amd64/stand/pxeboot/Makefile
+++ b/sys/arch/amd64/stand/pxeboot/Makefile
@@ -1,11 +1,9 @@
-# $OpenBSD: Makefile,v 1.13 2012/10/29 14:20:10 jsing Exp $
-
-.include "${.CURDIR}/../Makefile.inc"
+# $OpenBSD: Makefile,v 1.14 2013/01/17 12:25:11 jsing Exp $
MAN= pxeboot.8
.if ${MACHINE} == "amd64"
-S =${.CURDIR}/../../../..
+S= ${.CURDIR}/../../../..
SADIR= ${.CURDIR}/..
PROG= pxeboot