2001-04-10 06:20:02 +04:00
# Copyright (C) 2001 MandrakeSoft S.A.
2001-04-10 05:04:59 +04:00
#
# MandrakeSoft S.A.
# 43, rue d'Aboukir
# 75002 Paris - France
# http://www.linux-mandrake.com/
# http://www.mandrakesoft.com/
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2001-05-24 09:36:07 +04:00
#
####################################################
# NOTE: To be compatibile with nmake (microsoft vc++) please follow
# the following rules:
# use $(VAR) not ${VAR}
2001-04-10 05:04:59 +04:00
2001-06-06 17:57:24 +04:00
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
man1dir = $( mandir) /man1
2001-09-14 08:19:08 +04:00
DESTDIR =
2001-06-06 17:57:24 +04:00
VERSION = 1.2.cvs
2001-05-23 12:22:23 +04:00
VER_STRING = cvs-snapshot
REL_STRING =
2001-06-06 17:57:24 +04:00
BOCHSDIR = $( prefix) /bochs
VERSIONDIR = $( BOCHSDIR) /$( VERSION)
2001-06-04 08:26:56 +04:00
MAN_PAGE_LIST = bochs bochsrc bximage bochs-dlx
2001-06-06 17:57:24 +04:00
INSTALL_LIST = bios/BIOS-* CHANGES COPYING README bios/VGABIOS* bochs bximage install-x11-fonts
2001-06-04 08:26:56 +04:00
INSTALL_LIST_SED = DOC-linux.html
2001-06-06 17:57:24 +04:00
BOCHS_SCRIPTS = bochs-docs
2001-05-22 20:12:01 +04:00
CP = cp
CAT = cat
RM = rm
2001-05-22 21:20:45 +04:00
MV = mv
2001-05-22 20:12:01 +04:00
LN_S = ln -sf
2001-06-12 16:46:05 +04:00
RPMSPEC = build/redhat/bochs.rpmspec.template
2001-06-02 11:37:38 +04:00
DLXLINUX_TAR = dlxlinux2.tar.gz
2001-05-24 09:36:07 +04:00
DLXLINUX_TAR_URL = http://bochs.sourceforge.net/guestos/$( DLXLINUX_TAR)
2001-05-31 19:30:30 +04:00
DLXLINUX_ROMFILE = BIOS-bochs-latest
2001-05-22 20:12:01 +04:00
GUNZIP = gunzip
WGET = wget
2001-05-22 21:20:45 +04:00
SED = sed
SOURCES = /usr/src/redhat/SOURCES
SPECS = /usr/src/redhat/SPECS
RPMS = /usr/src/redhat/RPMS
SRPMS = /usr/src/redhat/SRPMS
MKDIR = mkdir
2001-06-04 08:26:56 +04:00
RMDIR = rmdir
2001-05-22 21:20:45 +04:00
TAR = tar
RPM = rpm
2001-05-23 12:16:07 +04:00
CHMOD = chmod
CHOWN = chown
2001-04-10 05:04:59 +04:00
@ S U F F I X _ L I N E @
2001-09-14 08:19:08 +04:00
srcdir = @srcdir@
VPATH = @srcdir@
2001-04-10 05:04:59 +04:00
SHELL = /bin/sh
@ S E T _ M A K E @
CC = @CC@
CXX = @CXX@
CFLAGS = @CFLAGS@ $( MCH_CFLAGS) $( FLA_FLAGS)
CXXFLAGS = @CXXFLAGS@ $( MCH_CFLAGS) $( FLA_FLAGS)
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
2001-05-23 12:16:07 +04:00
# To compile with readline:
# linux needs just -lreadline
# solaris needs -lreadline -lcurses
2001-04-10 05:04:59 +04:00
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
GUI_LINK_OPTS_X = $( X_LIBS) $( X_PRE_LIBS) -lX11
GUI_LINK_OPTS_BEOS = -lbe
2001-06-02 07:07:28 +04:00
GUI_LINK_OPTS_RFB = @RFB_LIBS@
2001-08-16 00:33:47 +04:00
GUI_LINK_OPTS_AMIGAOS =
2001-04-10 05:04:59 +04:00
GUI_LINK_OPTS_WIN32 = -luser32 -lgdi32 -lwinmm -lcomdlg32 -lcomctl32
GUI_LINK_OPTS_WIN32_VCPP = user32.lib gdi32.lib winmm.lib \
comdlg32.lib comctl32.lib wsock32.lib
GUI_LINK_OPTS_MACOS =
GUI_LINK_OPTS_NOGUI =
2001-05-08 23:07:26 +04:00
GUI_LINK_OPTS_TERM = @GUI_LINK_OPTS_TERM@
2001-04-10 05:04:59 +04:00
GUI_LINK_OPTS = @GUI_LINK_OPTS@
RANLIB = @RANLIB@
2001-09-14 08:19:08 +04:00
BX_INCDIRS = -I. -I$( srcdir) /. -I@INSTRUMENT_DIR@ -I$( srcdir) /@INSTRUMENT_DIR@
2001-04-10 05:04:59 +04:00
MDEFINES = CC = " $( CC) " CXX = " $( CXX) " CFLAGS = " $( CFLAGS) " CXXFLAGS = " $( CXXFLAGS) " \
LDFLAGS = " $( LDFLAGS) " LIBS = " $( LIBS) " \
X_LIBS = " $( X_LIBS) " X_PRE_LIBS = " $( X_PRE_LIBS) " \
prefix = " $( prefix) " exec_prefix = " $( exec_prefix) " \
bindir = " $( bindir) " infodir = " $( infodir) "
#SUBDIRS = iodev debug
#all install uninstall: config.h#
# for subdir in $(SUBDIRS); do #
# echo making $@ in $$subdir; #
# (cd $$subdir && $(MAKE) $(MDEFINES) $@) || exit 1; #
# done#
# gnu flags for clean up
#CFLAGS = -ansi -O -g -Wunused -Wuninitialized
NONINLINE_OBJS = \
2001-06-19 20:31:28 +04:00
logio.o \
2001-04-10 05:04:59 +04:00
main.o \
load32bitOShack.o \
state_file.o \
2001-04-10 05:51:50 +04:00
pc_system.o \
2001-04-10 06:02:37 +04:00
osdep.o
2001-04-10 05:04:59 +04:00
EXTERN_ENVIRONMENT_OBJS = \
main.o \
load32bitOShack.o \
state_file.o \
pc_system.o
DEBUGGER_LIB = debug/libdebug.a
DISASM_LIB = disasm/libdisasm.a
DYNAMIC_LIB = dynamic/libdynamic.a
INSTRUMENT_LIB = @INSTRUMENT_DIR@/libinstrument.a
FPU_LIB = fpu/libfpu.a
2001-05-23 12:16:07 +04:00
READLINE_LIB = @READLINE_LIB@
2001-04-10 05:04:59 +04:00
BX_OBJS = @NONINLINE_VAR@
2001-04-10 05:51:50 +04:00
BX_INCLUDES = bochs.h config.h osdep.h
2001-04-10 05:04:59 +04:00
.@CPP_SUFFIX@.o :
$( CXX) @DASH@c $( CXXFLAGS) $( BX_INCDIRS) @CXXFP@$< @OFP@$@
2001-06-01 09:58:46 +04:00
.c.o :
$( CC) @DASH@c $( CFLAGS) $( FPU_FLAGS) $( BX_INCDIRS) $< @OFP@$@
2001-04-10 05:04:59 +04:00
2001-06-01 09:21:25 +04:00
all : @PRIMARY_TARGET @ bximage @EXE @
2001-04-10 05:04:59 +04:00
@ E X T E R N A L _ D E P E N D E N C Y @
bochs@EXE@ : @IODEV_LIB_VAR @ @DEBUGGER_VAR @ \
cpu/libcpu.a memory/libmemory.a gui/libgui.a \
@DISASM_VAR@ @INSTRUMENT_VAR@ @DYNAMIC_VAR@ $( BX_OBJS) \
$( SIMX86_OBJS) \
$( FPU_LIB)
@LINK@ $( BX_OBJS) \
$( SIMX86_OBJS) \
iodev/libiodev.a \
cpu/libcpu.a memory/libmemory.a gui/libgui.a \
@DEBUGGER_VAR@ @DISASM_VAR@ @INSTRUMENT_VAR@ @DYNAMIC_VAR@ \
$( FPU_LIB) \
$( GUI_LINK_OPTS) \
$( MCH_LINK_FLAGS) \
2001-05-23 12:16:07 +04:00
$( SIMX86_LINK_FLAGS) \
$( READLINE_LIB)
2001-04-10 05:04:59 +04:00
2001-06-01 09:58:46 +04:00
bximage@EXE@ : misc /bximage .o
@LINK@ misc/bximage.o
2001-04-10 05:04:59 +04:00
$(BX_OBJS) : $( BX_INCLUDES )
2001-05-22 22:49:11 +04:00
bxversion.h ::
2001-05-24 09:36:07 +04:00
$( RM) -f bxversion.h
2001-05-22 22:49:11 +04:00
echo '// This file is generated by "make bxversion.h"' > bxversion.h
echo " #define VER_STRING \" $( VER_STRING) \" " >> bxversion.h
echo " #define REL_STRING \" $( REL_STRING) \" " >> bxversion.h
2001-04-10 05:04:59 +04:00
2001-05-14 19:32:43 +04:00
iodev/libiodev.a ::
2001-04-10 05:04:59 +04:00
cd iodev @COMMAND_SEPARATOR@
$( MAKE) $( MDEFINES) libiodev.a
@CD_UP_ONE@
2001-05-14 19:32:43 +04:00
debug/libdebug.a ::
2001-04-10 05:04:59 +04:00
cd debug @COMMAND_SEPARATOR@
$( MAKE) $( MDEFINES) libdebug.a
@CD_UP_ONE@
2001-05-14 19:32:43 +04:00
cpu/libcpu.a ::
2001-04-10 05:04:59 +04:00
cd cpu @COMMAND_SEPARATOR@
$( MAKE) $( MDEFINES) libcpu.a
@CD_UP_ONE@
2001-05-14 19:32:43 +04:00
memory/libmemory.a ::
2001-04-10 05:04:59 +04:00
cd memory @COMMAND_SEPARATOR@
$( MAKE) $( MDEFINES) libmemory.a
@CD_UP_ONE@
2001-05-14 19:32:43 +04:00
gui/libgui.a ::
2001-04-10 05:04:59 +04:00
cd gui @COMMAND_SEPARATOR@
$( MAKE) $( MDEFINES) libgui.a
@CD_UP_ONE@
2001-05-14 19:32:43 +04:00
disasm/libdisasm.a ::
2001-04-10 05:04:59 +04:00
cd disasm @COMMAND_SEPARATOR@
$( MAKE) $( MDEFINES) libdisasm.a
@CD_UP_ONE@
2001-05-14 19:32:43 +04:00
dynamic/libdynamic.a ::
2001-04-10 05:04:59 +04:00
cd dynamic @COMMAND_SEPARATOR@
$( MAKE) $( MDEFINES) libdynamic.a
@CD_UP_ONE@
2001-05-14 19:32:43 +04:00
@INSTRUMENT_DIR@/libinstrument.a ::
2001-04-10 05:04:59 +04:00
cd @INSTRUMENT_DIR@ @COMMAND_SEPARATOR@
$( MAKE) $( MDEFINES) libinstrument.a
@CD_UP_TWO@
2001-05-14 19:32:43 +04:00
fpu/libfpu.a ::
2001-04-10 05:04:59 +04:00
cd fpu @COMMAND_SEPARATOR@
$( MAKE) $( MDEFINES) libfpu.a
@CD_UP_ONE@
libbochs.a :
-rm -f libbochs.a
ar rv libbochs.a $( EXTERN_ENVIRONMENT_OBJS)
$( RANLIB) libbochs.a
libbochs_cpu.a : @DEBUGGER_VAR @ $( BX_OBJS )
-rm -f libbochs_cpu.a
ar rv libbochs_cpu.a $( BX_OBJS)
$( RANLIB) libbochs_cpu.a
2001-06-06 17:57:24 +04:00
install : all install_bin install_man install_fonts
install_fonts ::
2001-09-14 08:19:08 +04:00
srcdir = $( srcdir) $( VERSIONDIR) /install-x11-fonts
2001-05-22 20:12:01 +04:00
install_bin ::
2001-09-14 08:19:08 +04:00
-mkdir -p $( DESTDIR) $( BOCHSDIR)
-mkdir -p $( DESTDIR) $( VERSIONDIR)
-mkdir -p $( DESTDIR) $( bindir)
test -d $( DESTDIR) $( VERSIONDIR)
test -w $( DESTDIR) $( VERSIONDIR)
for i in bochs-docs; do cat $( srcdir) /build/linux/$$ i | $( SED) -e 's/@VERSION@/$(VERSION)/g' > $( DESTDIR) $( bindir) /$$ i; $( CHMOD) 755 $( DESTDIR) $( bindir) /$$ i; done
for i in $( INSTALL_LIST_SED) ; do cat $( srcdir) /build/linux/$$ i | $( SED) -e 's/@VERSION@/$(VERSION)/g' > $( DESTDIR) $( VERSIONDIR) /$$ i; $( CHMOD) 644 $( DESTDIR) $( VERSIONDIR) /$$ i; done
for i in $( INSTALL_LIST) ; do /bin/cp $( srcdir) /$$ i $( DESTDIR) $( VERSIONDIR) ; done
$( LN_S) $( VERSIONDIR) /bochs $( DESTDIR) $( bindir) /bochs
$( LN_S) $( VERSIONDIR) /bximage $( DESTDIR) $( bindir) /bximage
$( CP) -r $( srcdir) /docs-html $( DESTDIR) $( VERSIONDIR)
$( RM) -f $( DESTDIR) $( VERSIONDIR) /README
$( CAT) $( srcdir) /build/linux/README.linux-binary $( srcdir) /README > $( DESTDIR) $( VERSIONDIR) /README
$( CP) $( srcdir) /font/vga.pcf $( DESTDIR) $( VERSIONDIR)
$( CP) $( srcdir) /.bochsrc $( DESTDIR) $( VERSIONDIR) /bochsrc-sample.txt
$( RM) -f $( DESTDIR) $( BOCHSDIR) /latest
$( LN_S) $( VERSION) $( DESTDIR) $( BOCHSDIR) /latest
2001-05-22 20:12:01 +04:00
2001-06-04 08:26:56 +04:00
install_man ::
2001-09-14 08:19:08 +04:00
-mkdir -p $( DESTDIR) $( man1dir)
for i in $( MAN_PAGE_LIST) ; do cat $( srcdir) /doc/man/$$ i.1 | $( SED) -e 's/@VERSION@/$(VERSION)/g' > $( DESTDIR) $( man1dir) /$$ i.1; chmod 644 $( DESTDIR) $( man1dir) /$$ i.1; done
2001-06-04 08:26:56 +04:00
2001-05-22 20:12:01 +04:00
install_dlx ::
2001-05-24 09:36:07 +04:00
$( RM) -f $( DLXLINUX_TAR)
$( WGET) $( DLXLINUX_TAR_URL)
2001-06-06 17:57:24 +04:00
$( RM) -rf $( BOCHSDIR) /dlxlinux
$( GUNZIP) -c $( DLXLINUX_TAR) | ( cd $( BOCHSDIR) ; tar -xvf -)
2001-06-02 11:37:38 +04:00
$( RM) -f $( DLXLINUX_TAR)
2001-06-06 17:57:24 +04:00
test -d $( BOCHSDIR) /dlxlinux
( cd $( BOCHSDIR) /dlxlinux; $( MV) bochsrc.txt bochsrc.txt.orig; $( SED) -e " s/1\.1\.2/ $( VERSION) /g " < bochsrc.txt.orig > bochsrc.txt; rm -f bochsrc.txt.orig)
$( CHOWN) -R root.root $( BOCHSDIR) /dlxlinux
$( CHMOD) 777 $( BOCHSDIR) /dlxlinux
$( CHMOD) 666 $( BOCHSDIR) /dlxlinux/*
$( CHMOD) 644 $( BOCHSDIR) /dlxlinux/README
for i in bochs-dlx; do cat build/linux/$$ i | $( SED) -e 's/@VERSION@/$(VERSION)/g' > $( bindir) /$$ i; $( CHMOD) 755 $( bindir) /$$ i; done
uninstall ::
$( RM) -rf $( VERSIONDIR)
$( RM) -rf $( BOCHSDIR) /dlxlinux
$( RM) -rf $( BOCHSDIR) /latest
-$( RMDIR) $( BOCHSDIR)
for i in bochs bximage bochs-dlx $( BOCHS_SCRIPTS) ; do rm -f /usr/local/bin/$$ i; done
for i in $( MAN_PAGE_LIST) ; do $( RM) -f $( man1dir) /$$ i.1; done
2001-05-22 20:12:01 +04:00
2001-05-22 21:20:45 +04:00
rpm :: dist -clean
2001-05-24 09:36:07 +04:00
test -w $( SOURCES)
test -w $( SPECS)
2001-05-22 21:20:45 +04:00
rm -f /usr/src/redhat/SPECS/bochs.spec
2001-06-12 16:46:05 +04:00
$( CAT) $( RPMSPEC) | $( SED) " s/@VERSION@/ $( VERSION) /g " > $( SPECS) /bochs.spec
2001-05-24 09:36:07 +04:00
$( RM) -rf $( SOURCES) /bochs
$( MKDIR) $( SOURCES) /bochs
$( TAR) cf - * .??* | ( cd $( SOURCES) /bochs && tar xf -)
( cd $( SOURCES) ; tar czf bochs.tar.gz bochs)
$( RPM) -ba $( SPECS) /bochs.spec
2001-05-22 20:12:01 +04:00
2001-04-10 05:04:59 +04:00
clean :
@RMCOMMAND@ *.o
merge in BRANCH-io-cleanup.
To see the commit logs for this use either cvsweb or
cvs update -r BRANCH-io-cleanup and then 'cvs log' the various files.
In general this provides a generic interface for logging.
logfunctions:: is a class that is inherited by some classes, and also
. allocated as a standalone global called 'genlog'. All logging uses
. one of the ::info(), ::error(), ::ldebug(), ::panic() methods of this
. class through 'BX_INFO(), BX_ERROR(), BX_DEBUG(), BX_PANIC()' macros
. respectively.
.
. An example usage:
. BX_INFO(("Hello, World!\n"));
iofunctions:: is a class that is allocated once by default, and assigned
as the iofunction of each logfunctions instance. It is this class that
maintains the file descriptor and other output related code, at this
point using vfprintf(). At some future point, someone may choose to
write a gui 'console' for bochs to which messages would be redirected
simply by assigning a different iofunction class to the various logfunctions
objects.
More cleanup is coming, but this works for now. If you want to see alot
of debugging output, in main.cc, change onoff[LOGLEV_DEBUG]=0 to =1.
Comments, bugs, flames, to me: todd@fries.net
2001-05-15 18:49:57 +04:00
@RMCOMMAND@ */*.o
2001-04-10 05:04:59 +04:00
@RMCOMMAND@ *.a
merge in BRANCH-io-cleanup.
To see the commit logs for this use either cvsweb or
cvs update -r BRANCH-io-cleanup and then 'cvs log' the various files.
In general this provides a generic interface for logging.
logfunctions:: is a class that is inherited by some classes, and also
. allocated as a standalone global called 'genlog'. All logging uses
. one of the ::info(), ::error(), ::ldebug(), ::panic() methods of this
. class through 'BX_INFO(), BX_ERROR(), BX_DEBUG(), BX_PANIC()' macros
. respectively.
.
. An example usage:
. BX_INFO(("Hello, World!\n"));
iofunctions:: is a class that is allocated once by default, and assigned
as the iofunction of each logfunctions instance. It is this class that
maintains the file descriptor and other output related code, at this
point using vfprintf(). At some future point, someone may choose to
write a gui 'console' for bochs to which messages would be redirected
simply by assigning a different iofunction class to the various logfunctions
objects.
More cleanup is coming, but this works for now. If you want to see alot
of debugging output, in main.cc, change onoff[LOGLEV_DEBUG]=0 to =1.
Comments, bugs, flames, to me: todd@fries.net
2001-05-15 18:49:57 +04:00
@RMCOMMAND@ */*.a
2001-04-10 05:04:59 +04:00
@RMCOMMAND@ bochs@EXE@
2001-06-02 11:37:38 +04:00
@RMCOMMAND@ bximage@EXE@
2001-04-10 05:04:59 +04:00
@RMCOMMAND@ bochs.out
2001-06-02 11:37:38 +04:00
@RMCOMMAND@ bochsout.txt
2001-04-10 05:04:59 +04:00
local-dist-clean : clean
@RMCOMMAND@ config.h config.status config.log config.cache
all-clean : clean
cd iodev @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_ONE@
cd debug @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_ONE@
cd cpu @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_ONE@
cd memory @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_ONE@
cd gui @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_ONE@
cd disasm @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_ONE@
cd @INSTRUMENT_DIR@ @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_TWO@
cd misc @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_ONE@
cd dynamic @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_ONE@
cd fpu @COMMAND_SEPARATOR@
$( MAKE) clean
@CD_UP_ONE@
dist-clean : local -dist -clean
cd iodev @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
cd debug @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
cd bios @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
cd cpu @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
cd memory @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
cd gui @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
cd disasm @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
cd @INSTRUMENT_DIR@ @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_TWO@
cd misc @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
cd dynamic @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
cd fpu @COMMAND_SEPARATOR@
$( MAKE) dist-clean
@CD_UP_ONE@
@RMCOMMAND@ Makefile