Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / usr.bin / doscmd / Makefile
1 # from BSDI Makefile,v 2.6 1996/04/08 20:06:40 bostic Exp
2 #
3 # $FreeBSD: src/usr.bin/doscmd/Makefile,v 1.21.2.5 2002/08/07 16:32:01 ru Exp $
4 # $DragonFly: src/usr.bin/doscmd/Makefile,v 1.2 2003/06/17 04:29:25 dillon Exp $
5
6 PROG=   doscmd
7 SRCS=   AsyncIO.c ParseBuffer.c bios.c callback.c cmos.c config.c cpu.c cwd.c \
8         debug.c disktab.c dos.c doscmd.c ems.c emuint.c exe.c i386-pinsn.c \
9         int.c int10.c int13.c int14.c int16.c int17.c int1a.c int2f.c intff.c \
10         mem.c mouse.c net.c port.c setver.c signal.c timer.c trace.c trap.c \
11         tty.c video.c xms.c ${FONTHDRS}
12 CFLAGS+=        -I. -DDISASSEMBLER
13 FONTFILES=      cp437-8x8.pcf.gz cp437-8x14.pcf.gz cp437-8x16.pcf.gz
14 FONTHDRS=       font8x8.h font8x14.h font8x16.h
15 CLEANFILES=     ${FONTFILES} ${FONTHDRS} emsdriv.sys redir.com
16
17 XINCDIR=        ${DESTDIR}${X11BASE}/include
18 .if ${OBJFORMAT} == "aout"
19 CLEANFILES+=    doscmd.kernel crt0.o doscmd_loader.o
20 XLIBDIR=        ${DESTDIR}${X11BASE}/lib/aout
21 LDADD=          -L${DESTDIR}${LIBDIR} -lgcc -lc
22 DPADD=          ${LIBGCC} ${LIBC}
23 .else
24 XLIBDIR=        ${DESTDIR}${X11BASE}/lib
25 .endif
26
27 EXEGRP:=        ${BINGRP}
28 EXEMODE=        ${NOBINMODE}
29 #BINGRP=                kmem
30 #BINMODE=       2555
31
32 .if !defined(NO_X) && exists(${XINCDIR}/X11/X.h) && exists(${XLIBDIR}/libX11.a)
33 CFLAGS+=        -I${XINCDIR}
34 LDADD+=         -L${XLIBDIR} -lX11
35 DPADD+=         ${XLIBDIR}/libX11.a
36 .else
37 CFLAGS+=        -DNO_X
38 .endif
39
40 beforeinstall:
41 .if ${OBJFORMAT} == "aout"
42         ${INSTALL} -o ${BINOWN} -g ${EXEGRP} -m ${EXEMODE} \
43             doscmd.kernel ${DESTDIR}/usr/libexec/
44 .endif
45         ${INSTALL} -o ${BINOWN} -g ${EXEGRP} -m ${EXEMODE} \
46             emsdriv.sys redir.com ${DESTDIR}/usr/libdata/doscmd/
47         ${INSTALL} -o ${BINOWN} -g ${EXEGRP} -m ${SHAREMODE} \
48             ${FONTFILES} ${DESTDIR}/usr/libdata/doscmd/fonts
49         cd ${.CURDIR} && \
50             ${INSTALL} -o ${BINOWN} -g ${EXEGRP} -m ${SHAREMODE} \
51                 fonts.dir ${DESTDIR}/usr/libdata/doscmd/fonts
52
53 .if ${OBJFORMAT} == "aout"
54 doscmd: ${LIBCRT0} doscmd_loader.o ${LIBGCC} ${LIBC}
55         ${CC} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-e,start,-dc,-dp \
56             -o doscmd ${LIBCRT0} doscmd_loader.o -lgcc -lc
57
58 # Bogusly generated dependency to get doscmd_loader.c looked at by mkdep.
59 .depend: doscmd_loader.c
60
61 # Bogus dependencies to get more than one binary created by `make all'.
62 doscmd: ${FONTFILES} ${FONTHDRS} doscmd.kernel emsdriv.sys redir.com
63 .else
64 doscmd: ${FONTFILES} ${FONTHDRS} emsdriv.sys redir.com
65 .endif
66
67 cp437-8x8.pcf.gz: cp437-8x8.pcf.gz.uu
68         uudecode ${.CURDIR}/cp437-8x8.pcf.gz.uu
69
70 cp437-8x14.pcf.gz: cp437-8x14.pcf.gz.uu
71         uudecode ${.CURDIR}/cp437-8x14.pcf.gz.uu
72
73 cp437-8x16.pcf.gz: cp437-8x16.pcf.gz.uu
74         uudecode ${.CURDIR}/cp437-8x16.pcf.gz.uu
75
76 emsdriv.sys: emsdriv.sys.uu
77         uudecode ${.CURDIR}/emsdriv.sys.uu
78
79 font8x8.h: ${.CURDIR}/../../share/syscons/fonts/cp437-8x8.fnt
80         uudecode -p ${.ALLSRC} | \
81                 file2c 'u_int8_t font8x8[] = {' '};' > ${.TARGET}
82
83 font8x14.h: ${.CURDIR}/../../share/syscons/fonts/cp437-8x14.fnt
84         uudecode -p ${.ALLSRC} | \
85                 file2c 'u_int8_t font8x14[] = {' '};' > ${.TARGET}
86
87 font8x16.h: ${.CURDIR}/../../share/syscons/fonts/cp437-8x16.fnt
88         uudecode -p ${.ALLSRC} | \
89                 file2c 'u_int8_t font8x16[] = {' '};' > ${.TARGET}
90
91 redir.com: redir.com.uu
92         uudecode ${.CURDIR}/redir.com.uu
93
94 # Make sure the library names are defined.  We want to specify the full
95 # path to the standard crt0.o, and building two binaries in one directory
96 # breaks the automatic generation of dependencies for binaries.
97 NEED_LIBNAMES=  yes
98
99 .include <bsd.prog.mk>
100
101 .if ${OBJFORMAT} == "aout"
102 # This must be after bsd.prog.mk is included so that ${OBJS} in the
103 # dependency gets expanded.
104 doscmd.kernel: crt0.o ${OBJS} ${DPADD}
105         ${CC} ${CFLAGS} ${LDFLAGS} -static -nostdlib -Wl,-N,-T,110000 \
106             -o doscmd.kernel crt0.o ${OBJS} ${LDADD}
107 .endif