Skip to content

Commit

Permalink
make it compile on 4.1-current XXX quickhack
Browse files Browse the repository at this point in the history
  • Loading branch information
itojun committed Jun 14, 2007
1 parent cc44d59 commit 7a32ec8
Showing 1 changed file with 33 additions and 17 deletions.
50 changes: 33 additions & 17 deletions openbsd/sys/arch/i386/conf/Makefile.i386
@@ -1,5 +1,4 @@
# $OpenBSD: Makefile.i386,v 1.23 1998/08/10 22:08:27 mickey Exp $
# $NetBSD: Makefile.i386,v 1.67 1996/05/11 16:12:11 mycroft Exp $
# $OpenBSD: Makefile.i386,v 1.40 2004/05/11 04:01:00 deraadt Exp $

# Makefile for OpenBSD
#
Expand All @@ -22,13 +21,11 @@
# DEBUG is set to -g if debugging.
# PROF is set to -pg if profiling.

AS?= as
CC?= cc
.include <bsd.own.mk>

MKDEP?= mkdep
CPP?= cpp
LD?= ld
SIZE?= size
STRIP?= strip
TOUCH?= touch

# source tree is located via $S relative to the compilation directory
.ifndef S
Expand All @@ -38,21 +35,24 @@ I386= $S/arch/i386

INCLUDES= -nostdinc -I. -I$S/arch -I$S
CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Di386

CDIAGFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
-Wno-uninitialized -Wno-format -Wno-main

.if ${IDENT:M-D*_CPU} == ${IDENT:M-DI486_CPU}
CMACHFLAGS= -m486
.if !${IDENT:M-DI386_CPU}
CMACHFLAGS= -march=i486
.else
CMACHFLAGS=
.endif
.if ${IDENT:M-DNO_PROPOLICE}
CMACHFLAGS+= -fno-stack-protector
.endif
CMACHFLAGS+= -fno-builtin -fno-builtin-log

CFLAGS= ${DEBUG} -O2 ${CDIAGFLAGS} ${CMACHFLAGS} ${COPTS}
COPTS?= -O2
CFLAGS= ${DEBUG} ${CDIAGFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
LINKFLAGS= -z -Ttext F0100000 -e start
STRIPFLAGS= -d
TOUCHFLAGS= -f -c
LINKFLAGS= -Ttext 0xD0100120 -e start -N
STRIPFLAGS= -g -X -x

HOSTCC= ${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
Expand Down Expand Up @@ -107,7 +107,7 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD= rm -f $@
SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
SYSTEM_LD_TAIL= @size $@; chmod 755 $@
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@

DEBUG?=
.if ${DEBUG} == "-g"
Expand All @@ -121,7 +121,7 @@ LINKFLAGS+= -x

%LOAD

assym.h: $S/kern/genassym.sh ${I386}/i386/genassym.cf
assym.h: $S/kern/genassym.sh ${I386}/i386/genassym.cf Makefile
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
${PARAM} < ${I386}/i386/genassym.cf > assym.h.tmp && \
mv -f assym.h.tmp assym.h
Expand All @@ -147,7 +147,7 @@ clean::

lint:
@lint -hbxncez -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
${CFILES} ${I386}/i386/swapgeneric.c ioconf.c param.c | \
${CFILES} ioconf.c param.c | \
grep -v 'static function .* unused'

tags:
Expand All @@ -168,6 +168,10 @@ depend:: .depend
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
${CPPFLAGS} < ${I386}/i386/genassym.cf
@sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
@rm -f assym.dep


# depend on root or device configuration
Expand All @@ -190,4 +194,16 @@ locore.o machdep.o: Makefile
locore.o: ${I386}/i386/locore.s assym.h
${NORMAL_S}

# The install target can be redefined by putting a
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
MACHINE_NAME!= uname -n
install: install-kernel-${MACHINE_NAME}
.if !target(install-kernel-${MACHINE_NAME}})
install-kernel-${MACHINE_NAME}:
rm -f /obsd
ln /bsd /obsd
cp bsd /nbsd
mv /nbsd /bsd
.endif

%RULES

0 comments on commit 7a32ec8

Please sign in to comment.