353 lines
8.8 KiB
Makefile
353 lines
8.8 KiB
Makefile
# Copyright (C) 2001 MandrakeSoft S.A.
|
|
#
|
|
# 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
|
|
#
|
|
####################################################
|
|
# NOTE: To be compatibile with nmake (microsoft vc++) please follow
|
|
# the following rules:
|
|
# use $(VAR) not ${VAR}
|
|
|
|
VERSION=1.2.x
|
|
VER_STRING=cvs-snapshot
|
|
REL_STRING=
|
|
PREFIX=/usr/local/bochs
|
|
BINPATH=/usr/local/bin
|
|
INSTALL_LIST=bios/BIOS-* CHANGES COPYING README bios/VGABIOS* bochs bximage build/linux/DOC-linux.html
|
|
CP=cp
|
|
CAT=cat
|
|
RM=rm
|
|
MV=mv
|
|
LN_S=ln -sf
|
|
DLXLINUX_TAR=dlxlinux2.tar.gz
|
|
DLXLINUX_TAR_URL=http://bochs.sourceforge.net/guestos/$(DLXLINUX_TAR)
|
|
DLXLINUX_ROMFILE=BIOS-bochs-latest
|
|
GUNZIP=gunzip
|
|
WGET=wget
|
|
SED=sed
|
|
SOURCES=/usr/src/redhat/SOURCES
|
|
SPECS=/usr/src/redhat/SPECS
|
|
RPMS=/usr/src/redhat/RPMS
|
|
SRPMS=/usr/src/redhat/SRPMS
|
|
MKDIR=mkdir
|
|
TAR=tar
|
|
RPM=rpm
|
|
CHMOD=chmod
|
|
CHOWN=chown
|
|
|
|
@SUFFIX_LINE@
|
|
|
|
|
|
SHELL = /bin/sh
|
|
|
|
|
|
@SET_MAKE@
|
|
|
|
CC = @CC@
|
|
CXX = @CXX@
|
|
CFLAGS = @CFLAGS@ $(MCH_CFLAGS) $(FLA_FLAGS)
|
|
CXXFLAGS = @CXXFLAGS@ $(MCH_CFLAGS) $(FLA_FLAGS)
|
|
|
|
LDFLAGS = @LDFLAGS@
|
|
LIBS = @LIBS@
|
|
# To compile with readline:
|
|
# linux needs just -lreadline
|
|
# solaris needs -lreadline -lcurses
|
|
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
|
|
GUI_LINK_OPTS_RFB = @RFB_LIBS@
|
|
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 =
|
|
GUI_LINK_OPTS_TERM = @GUI_LINK_OPTS_TERM@
|
|
GUI_LINK_OPTS = @GUI_LINK_OPTS@
|
|
RANLIB = @RANLIB@
|
|
|
|
BX_INCDIRS = -I. -I@INSTRUMENT_DIR@
|
|
|
|
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 = \
|
|
main.o \
|
|
load32bitOShack.o \
|
|
state_file.o \
|
|
pc_system.o \
|
|
osdep.o
|
|
|
|
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
|
|
READLINE_LIB = @READLINE_LIB@
|
|
|
|
BX_OBJS = @NONINLINE_VAR@
|
|
|
|
BX_INCLUDES = bochs.h config.h osdep.h
|
|
|
|
|
|
.@CPP_SUFFIX@.o:
|
|
$(CXX) @DASH@c $(CXXFLAGS) $(BX_INCDIRS) @CXXFP@$< @OFP@$@
|
|
.c.o:
|
|
$(CC) @DASH@c $(CFLAGS) $(FPU_FLAGS) $(BX_INCDIRS) $< @OFP@$@
|
|
|
|
|
|
all: @PRIMARY_TARGET@ bximage@EXE@
|
|
|
|
|
|
@EXTERNAL_DEPENDENCY@
|
|
|
|
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) \
|
|
$(SIMX86_LINK_FLAGS) \
|
|
$(READLINE_LIB)
|
|
|
|
bximage@EXE@: misc/bximage.o
|
|
@LINK@ misc/bximage.o
|
|
|
|
$(BX_OBJS): $(BX_INCLUDES)
|
|
|
|
bxversion.h::
|
|
$(RM) -f bxversion.h
|
|
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
|
|
|
|
iodev/libiodev.a::
|
|
cd iodev @COMMAND_SEPARATOR@
|
|
$(MAKE) $(MDEFINES) libiodev.a
|
|
@CD_UP_ONE@
|
|
|
|
debug/libdebug.a::
|
|
cd debug @COMMAND_SEPARATOR@
|
|
$(MAKE) $(MDEFINES) libdebug.a
|
|
@CD_UP_ONE@
|
|
|
|
cpu/libcpu.a::
|
|
cd cpu @COMMAND_SEPARATOR@
|
|
$(MAKE) $(MDEFINES) libcpu.a
|
|
@CD_UP_ONE@
|
|
|
|
memory/libmemory.a::
|
|
cd memory @COMMAND_SEPARATOR@
|
|
$(MAKE) $(MDEFINES) libmemory.a
|
|
@CD_UP_ONE@
|
|
|
|
gui/libgui.a::
|
|
cd gui @COMMAND_SEPARATOR@
|
|
$(MAKE) $(MDEFINES) libgui.a
|
|
@CD_UP_ONE@
|
|
|
|
disasm/libdisasm.a::
|
|
cd disasm @COMMAND_SEPARATOR@
|
|
$(MAKE) $(MDEFINES) libdisasm.a
|
|
@CD_UP_ONE@
|
|
|
|
dynamic/libdynamic.a::
|
|
cd dynamic @COMMAND_SEPARATOR@
|
|
$(MAKE) $(MDEFINES) libdynamic.a
|
|
@CD_UP_ONE@
|
|
|
|
@INSTRUMENT_DIR@/libinstrument.a::
|
|
cd @INSTRUMENT_DIR@ @COMMAND_SEPARATOR@
|
|
$(MAKE) $(MDEFINES) libinstrument.a
|
|
@CD_UP_TWO@
|
|
|
|
fpu/libfpu.a::
|
|
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
|
|
|
|
install: all install_bin install_dlx
|
|
|
|
install_bin::
|
|
for i in bochs-dlx bochs-docs; do cat build/linux/$$i | $(SED) -e 's/@VERSION@/$(VERSION)/g' > $(BINPATH)/$$i; $(CHMOD) 755 $(BINPATH)/$$i; done
|
|
-mkdir $(PREFIX)
|
|
-mkdir $(PREFIX)/$(VERSION)
|
|
test -d $(PREFIX)/$(VERSION)
|
|
test -w $(PREFIX)/$(VERSION)
|
|
for i in $(INSTALL_LIST); do /bin/cp $$i $(PREFIX)/$(VERSION); done
|
|
$(LN_S) $(PREFIX)/$(VERSION)/bochs $(BINPATH)/bochs
|
|
$(LN_S) $(PREFIX)/$(VERSION)/bximage $(BINPATH)/bximage
|
|
$(CP) -r docs-html $(PREFIX)/$(VERSION)
|
|
$(RM) -f $(PREFIX)/$(VERSION)/README
|
|
$(CAT) build/linux/README.linux-binary README > $(PREFIX)/$(VERSION)/README
|
|
$(CP) font/vga.pcf $(PREFIX)/$(VERSION)
|
|
$(CP) .bochsrc $(PREFIX)/$(VERSION)/bochsrc-sample.txt
|
|
$(LN_S) $(VERSION) $(PREFIX)/latest
|
|
|
|
install_dlx::
|
|
$(RM) -f $(DLXLINUX_TAR)
|
|
$(WGET) $(DLXLINUX_TAR_URL)
|
|
$(RM) -rf $(PREFIX)/dlxlinux
|
|
$(GUNZIP) -c $(DLXLINUX_TAR) | (cd $(PREFIX); tar -xvf -)
|
|
$(RM) -f $(DLXLINUX_TAR)
|
|
test -d $(PREFIX)/dlxlinux
|
|
(cd $(PREFIX)/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 $(PREFIX)/dlxlinux
|
|
$(CHMOD) 777 $(PREFIX)/dlxlinux
|
|
$(CHMOD) 666 $(PREFIX)/dlxlinux/*
|
|
$(CHMOD) 644 $(PREFIX)/dlxlinux/README
|
|
|
|
erase_install::
|
|
$(RM) -rf $(PREFIX)/$(VERSION)
|
|
$(RM) -rf $(PREFIX)/dlxlinux
|
|
|
|
rpm:: dist-clean
|
|
test -w $(SOURCES)
|
|
test -w $(SPECS)
|
|
rm -f /usr/src/redhat/SPECS/bochs.spec
|
|
$(CAT) build/linux/bochs.rpmspec.template | $(SED) "s/@VERSION@/$(VERSION)/g" > $(SPECS)/bochs.spec
|
|
$(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
|
|
|
|
clean:
|
|
@RMCOMMAND@ *.o
|
|
@RMCOMMAND@ */*.o
|
|
@RMCOMMAND@ *.a
|
|
@RMCOMMAND@ */*.a
|
|
@RMCOMMAND@ bochs@EXE@
|
|
@RMCOMMAND@ bximage@EXE@
|
|
@RMCOMMAND@ bochs.out
|
|
@RMCOMMAND@ bochsout.txt
|
|
|
|
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
|