freebsd-dev/usr.bin/doscmd/Makefile
bde 57fbdb99e2 Fixed DPADD. ${LIBGCC} must be added explicitly since the default
linkage rule is overridden.  The -L option must be in ${DPADD} so that
`make checkdpadd' works.  Actually use ${DPADD}.

FIxed missing dependencies for doscmd.  Use ${LIBCRT0} instead of a
hard-coded path in the rule for doscmd.

Added comments about the kludges used to build 2 binaries and 2 data
files in one directory.  It shouldn't be done this way.  The dependencies
on sources took extra work to get right, and the dependencies on objects
are still broken (one set is missing and the other has the wrong libs).

Fixed some style bugs while I'm here:
- don't override the (correct) default for MAN1.
- use `beforeinstall', not `afterinstall' to install auxiliary files.
  `afterinstall' is for fixing messes made by `install'.
1997-12-16 16:36:43 +00:00

64 lines
2.0 KiB
Makefile

# from BSDI Makefile,v 2.6 1996/04/08 20:06:40 bostic Exp
#
# $Id: Makefile,v 1.8 1997/09/30 22:03:34 jlemon Exp $
PROG= doscmd
SRCS= AsyncIO.c ParseBuffer.c bios.c callback.c cpu.c dos.c cmos.c config.c \
cwd.c debug.c disktab.c doscmd.c ems.c emuint.c exe.c i386-pinsn.c \
int.c int10.c int13.c int14.c int16.c int17.c int1a.c int2f.c intff.c \
mem.c mouse.c net.c port.c setver.c signal.c timer.c trace.c trap.c \
tty.c xms.c
CLEANFILES= doscmd.kernel crt0.o doscmd_loader.o redir.com emsdriv.sys
BINGRP= kmem
EXEGRP= bin
BINMODE=2555
EXEMODE=444
.if exists(${X11BASE}/include) && exists(${X11BASE}/lib/libX11.a)
CFLAGS+= -I. -I${X11BASE}/include -DDISASSEMBLER
LDADD= -L${X11BASE}/lib -lX11
DPADD= ${X11BASE}/lib/libX11.a
.else
CFLAGS+= -I. -DDISASSEMBLER -DNO_X
.endif
LDADD+= -lgcc -lc
DPADD+= ${LIBGCC} ${LIBC}
beforeinstall:
install ${COPY} -o ${BINOWN} -g ${EXEGRP} -m ${EXEMODE} \
doscmd.kernel ${DESTDIR}/usr/libexec/doscmd.kernel
install -c -o ${BINOWN} -g ${EXEGRP} -m ${EXEMODE} \
redir.com ${DESTDIR}/usr/libdata/doscmd/
install -c -o ${BINOWN} -g ${EXEGRP} -m ${EXEMODE} \
emsdriv.sys ${DESTDIR}/usr/libdata/doscmd/
doscmd: ${LIBCRT0} doscmd_loader.o ${LIBGCC} ${LIBC}
ld -e start -dc -dp -o doscmd ${LIBCRT0} doscmd_loader.o -lgcc -lc
# Bogusly generated dependency to get doscmd_loader.c looked at by mkdep.
.depend: doscmd_loader.c
# Bogus dependencies to get more than one binary created by `make all'.
doscmd: doscmd.kernel emsdriv.sys redir.com
redir.com: redir.com.uu
uudecode ${.CURDIR}/redir.com.uu
emsdriv.sys: emsdriv.sys.uu
uudecode ${.CURDIR}/emsdriv.sys.uu
# Make sure the library names are defined. We want to specify the full
# path to the standard crt0.o, and building two binaries in one directory
# breaks the automatic generation of dependencies for binaries.
.include <bsd.libnames.mk>
.include <bsd.prog.mk>
# This must be after bsd.prog.mk is included so that ${OBJS} in the
# dependency gets expanded.
doscmd.kernel: crt0.o ${OBJS} ${DPADD}
ld -N -Bstatic -T 110000 -o doscmd.kernel ${LDFLAGS} \
crt0.o ${OBJS} ${LDADD}