Enabled VPATH feature: changed nearly all Makefiles (149 files).
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 24 Apr 2006 20:29:10 +0000 (20:29 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 24 Apr 2006 20:29:10 +0000 (20:29 +0000)
See sdccman.lyx '2.4.10 VPATH feature' about how to use it.

One basic decision: e.g. src/clean.mk includes further files. In order
to make this work there are two solutions:
- rename another dozen clean.mk to clean_in.mk, add srcdir to them and
  run configure on them. This way they can use
  'include $(srcdir)/port-clean.mk'
- always include clean.mk by the Makefile at the same level. To avoid
  that `make clean` tries to include and build Makefile.dep the
  MAKECMDGOALS are examined (see e.g. src/Makefile.in). This has been
  implemented, because now even `make uninstall` doesn't create
  Makefile.in. clean.mk could be eliminated by pasting it in Makefile.in.

* debugger/mcs51/Makefile.in: build own objects from library sources (SLIB, SDCC) in current directory

* configure, configure.in: renamed --disable-device-lib-build in
  --disable-device-lib; added --enable-doc, the required tools are
  searched by configure; added result message; the toolchain for the
  belonging ports are now only built, if the port is enabled.

* support/regression/*: all output is written in directory gen, because the fwk and ports directories don't livet in the build tree using vpath

* doc/sdccman.lyx: renamed --disable-device-lib-build to --disable-device-lib, added --enable-doc, added section VPATH

* sim/ucsim/configure.in,
* sim/ucsim/configure.in: hc08 couldn't be disabled, now hc08 and z80 are enabled by default

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4121 4a8a32a2-be11-0410-ad9d-d568d2c75423

207 files changed:
ChangeLog
Makefile [deleted file]
Makefile.common.in
Makefile.in [new file with mode: 0644]
as/Makefile [deleted file]
as/Makefile.in [new file with mode: 0644]
as/clean.mk
as/hc08/Makefile.in
as/hc08/clean.mk
as/hc08/conf.mk
as/mcs51/Makefile.in
as/mcs51/clean.mk
as/mcs51/conf.mk
as/xa51/Makefile [deleted file]
as/xa51/Makefile.in [new file with mode: 0644]
as/z80/Makefile.in
as/z80/clean.mk
as/z80/conf.mk
clean.mk
configure
configure.in
debugger/mcs51/Makefile.in
debugger/mcs51/clean.mk
debugger/mcs51/conf.mk
device/examples/ds390/test390/Makefile
device/include/Makefile.in
device/include/conf.mk
device/lib/Makefile.in
device/lib/clean.mk
device/lib/conf.mk
device/lib/ds390/Makefile [deleted file]
device/lib/ds390/Makefile.in [new file with mode: 0755]
device/lib/ds400/Makefile [deleted file]
device/lib/ds400/Makefile.in [new file with mode: 0755]
device/lib/gbz80/Makefile [deleted file]
device/lib/gbz80/Makefile.in [new file with mode: 0644]
device/lib/hc08/Makefile [deleted file]
device/lib/hc08/Makefile.in [new file with mode: 0644]
device/lib/large/Makefile [deleted file]
device/lib/large/Makefile.in [new file with mode: 0644]
device/lib/mcs51/Makefile [deleted file]
device/lib/mcs51/Makefile.in [new file with mode: 0644]
device/lib/medium/Makefile [deleted file]
device/lib/medium/Makefile.in [new file with mode: 0644]
device/lib/pic/Makefile [deleted file]
device/lib/pic/Makefile.common.in
device/lib/pic/Makefile.in [new file with mode: 0644]
device/lib/pic/Makefile.rules
device/lib/pic/Makefile.subdir
device/lib/pic/configure
device/lib/pic/configure.in
device/lib/pic/libsdcc/Makefile [deleted file]
device/lib/pic/libsdcc/Makefile.in [new file with mode: 0644]
device/lib/pic16/Makefile [deleted file]
device/lib/pic16/Makefile.common.in
device/lib/pic16/Makefile.in [new file with mode: 0644]
device/lib/pic16/Makefile.rules
device/lib/pic16/Makefile.subdir
device/lib/pic16/configure
device/lib/pic16/configure.in
device/lib/pic16/debug/Makefile [deleted file]
device/lib/pic16/debug/Makefile.in [new file with mode: 0644]
device/lib/pic16/debug/gstack/Makefile [deleted file]
device/lib/pic16/debug/gstack/Makefile.in [new file with mode: 0644]
device/lib/pic16/libc/Makefile [deleted file]
device/lib/pic16/libc/Makefile.in [new file with mode: 0644]
device/lib/pic16/libc/ctype/Makefile [deleted file]
device/lib/pic16/libc/ctype/Makefile.in [new file with mode: 0644]
device/lib/pic16/libc/delay/Makefile [deleted file]
device/lib/pic16/libc/delay/Makefile.in [new file with mode: 0644]
device/lib/pic16/libc/stdio/Makefile [deleted file]
device/lib/pic16/libc/stdio/Makefile.in [new file with mode: 0644]
device/lib/pic16/libc/stdlib/Makefile [deleted file]
device/lib/pic16/libc/stdlib/Makefile.in [new file with mode: 0644]
device/lib/pic16/libc/string/Makefile [deleted file]
device/lib/pic16/libc/string/Makefile.in [new file with mode: 0644]
device/lib/pic16/libc/utils/Makefile [deleted file]
device/lib/pic16/libc/utils/Makefile.in [new file with mode: 0644]
device/lib/pic16/libdev/Makefile [deleted file]
device/lib/pic16/libdev/Makefile.in [new file with mode: 0644]
device/lib/pic16/libio/Makefile [deleted file]
device/lib/pic16/libio/Makefile.in [new file with mode: 0644]
device/lib/pic16/libio/adc/Makefile [deleted file]
device/lib/pic16/libio/adc/Makefile.in [new file with mode: 0644]
device/lib/pic16/libio/i2c/Makefile [deleted file]
device/lib/pic16/libio/i2c/Makefile.in [new file with mode: 0644]
device/lib/pic16/libio/usart/Makefile [deleted file]
device/lib/pic16/libio/usart/Makefile.in [new file with mode: 0644]
device/lib/pic16/libm/Makefile [deleted file]
device/lib/pic16/libm/Makefile.in [new file with mode: 0644]
device/lib/pic16/libsdcc/Makefile [deleted file]
device/lib/pic16/libsdcc/Makefile.in [new file with mode: 0644]
device/lib/pic16/libsdcc/char/Makefile [deleted file]
device/lib/pic16/libsdcc/char/Makefile.in [new file with mode: 0644]
device/lib/pic16/libsdcc/fixed16x16/Makefile [deleted file]
device/lib/pic16/libsdcc/fixed16x16/Makefile.in [new file with mode: 0644]
device/lib/pic16/libsdcc/float/Makefile [deleted file]
device/lib/pic16/libsdcc/float/Makefile.in [new file with mode: 0644]
device/lib/pic16/libsdcc/gptr/Makefile [deleted file]
device/lib/pic16/libsdcc/gptr/Makefile.in [new file with mode: 0644]
device/lib/pic16/libsdcc/int/Makefile [deleted file]
device/lib/pic16/libsdcc/int/Makefile.in [new file with mode: 0644]
device/lib/pic16/libsdcc/long/Makefile [deleted file]
device/lib/pic16/libsdcc/long/Makefile.in [new file with mode: 0644]
device/lib/pic16/libsdcc/lregs/Makefile [deleted file]
device/lib/pic16/libsdcc/lregs/Makefile.in [new file with mode: 0644]
device/lib/pic16/startup/Makefile [deleted file]
device/lib/pic16/startup/Makefile.in [new file with mode: 0644]
device/lib/small/Makefile [deleted file]
device/lib/small/Makefile.in [new file with mode: 0644]
device/lib/z80/Makefile [deleted file]
device/lib/z80/Makefile.in [new file with mode: 0644]
doc/Makefile [deleted file]
doc/Makefile.in [new file with mode: 0644]
doc/clean.mk
doc/sdccman.lyx
link/Makefile [deleted file]
link/Makefile.in [new file with mode: 0644]
link/clean.mk
link/z80/Makefile.in
link/z80/clean.mk
link/z80/conf.mk
main_in.mk
packihx/Makefile.in
packihx/clean.mk
sim/ucsim/Makefile [deleted file]
sim/ucsim/Makefile.in [new file with mode: 0644]
sim/ucsim/avr.src/Makefile.in
sim/ucsim/avr.src/conf.mk
sim/ucsim/clean.mk
sim/ucsim/cmd.src/Makefile.in
sim/ucsim/cmd.src/conf.mk
sim/ucsim/configure
sim/ucsim/configure.in
sim/ucsim/doc/Makefile.in
sim/ucsim/doc/conf.mk
sim/ucsim/gui.src/Makefile.in
sim/ucsim/gui.src/clean.mk
sim/ucsim/gui.src/conf.mk
sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in
sim/ucsim/gui.src/obsolete/portmon.src/conf.mk
sim/ucsim/gui.src/serio.src/Makefile.in
sim/ucsim/gui.src/serio.src/conf.mk
sim/ucsim/hc08.src/Makefile.in
sim/ucsim/hc08.src/conf.mk
sim/ucsim/libltdl/Makefile.in
sim/ucsim/main_in.mk
sim/ucsim/packages_in.mk
sim/ucsim/s51.src/Makefile.in
sim/ucsim/s51.src/conf.mk
sim/ucsim/sim.src/Makefile.in
sim/ucsim/sim.src/conf.mk
sim/ucsim/xa.src/Makefile.in
sim/ucsim/xa.src/conf.mk
sim/ucsim/z80.src/Makefile.in
sim/ucsim/z80.src/conf.mk
src/Makefile.in
src/avr/Makefile [deleted file]
src/avr/Makefile.in [new file with mode: 0644]
src/clean.mk
src/conf.mk
src/ds390/Makefile [deleted file]
src/ds390/Makefile.in [new file with mode: 0644]
src/ds400/Makefile [deleted file]
src/ds400/Makefile.in [new file with mode: 0644]
src/hc08/Makefile [deleted file]
src/hc08/Makefile.in [new file with mode: 0644]
src/izt/Makefile
src/mcs51/Makefile [deleted file]
src/mcs51/Makefile.in [new file with mode: 0644]
src/pic/Makefile [deleted file]
src/pic/Makefile.in [new file with mode: 0644]
src/pic16/Makefile [deleted file]
src/pic16/Makefile.in [new file with mode: 0644]
src/pic16/NOTES
src/port-clean.mk
src/port.mk
src/xa51/Makefile [deleted file]
src/xa51/Makefile.in [new file with mode: 0644]
src/z80/Makefile [deleted file]
src/z80/Makefile.in [new file with mode: 0644]
support/cpp2/Makefile.in
support/cpp2/clean.mk
support/librarian/Makefile [deleted file]
support/librarian/Makefile.in [new file with mode: 0644]
support/librarian/clean.mk
support/makebin/Makefile [deleted file]
support/makebin/Makefile.in [new file with mode: 0644]
support/makebin/clean.mk
support/regression/Makefile.in
support/regression/ports/ds390/spec.mk
support/regression/ports/gbz80/spec.mk
support/regression/ports/hc08/spec.mk
support/regression/ports/host/spec.mk
support/regression/ports/mcs51-large/spec.mk
support/regression/ports/mcs51-medium/spec.mk
support/regression/ports/mcs51-stack-auto/spec.mk
support/regression/ports/mcs51-xstack-auto/spec.mk
support/regression/ports/mcs51/spec.mk
support/regression/ports/pic16/spec.mk
support/regression/ports/ucz80/spec.mk
support/regression/ports/xa51/spec.mk
support/regression/ports/z80/spec.mk
support/regression/tests/libmullong.c
support/scripts/sdcc_mingw32
support/valdiag/Makefile [deleted file]
support/valdiag/Makefile.in [new file with mode: 0644]

index 3284909e14941f0046dcec5d7f232985dfe69a24..caa9dae5cda1bb80b1c9a10e7c3367add3f12029 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,38 @@
+2006-04-24 Bernhard Held <bernhard AT bernhardheld.de>
+
+       Enabled VPATH feature: changed nearly all Makefiles (149 files).
+       See sdccman.lyx '2.4.10 VPATH feature' about how to use it.
+
+       One basic decision: e.g. src/clean.mk includes further files. In order
+       to make this work there are two solutions:
+       - rename another dozen clean.mk to clean_in.mk, add srcdir to them and
+         run configure on them. This way they can use
+         'include $(srcdir)/port-clean.mk'
+       - always include clean.mk by the Makefile at the same level. To avoid
+         that `make clean` tries to include and build Makefile.dep the
+         MAKECMDGOALS are examined (see e.g. src/Makefile.in). This has been
+         implemented, because now even `make uninstall` doesn't create
+         Makefile.in. clean.mk could be eliminated by pasting it in
+         Makefile.in.
+
+       * debugger/mcs51/Makefile.in: build own objects from library sources
+       (SLIB, SDCC) in current directory
+
+       * configure, configure.in: renamed --disable-device-lib-build in 
+       --disable-device-lib; added --enable-doc, the required tools are
+       searched by configure; added result message; the toolchain for the
+       belonging ports are now only built, if the port is enabled.
+
+       * support/regression/*: all output is written in directory gen, because
+       the fwk and ports directories don't livet in the build tree using vpath
+
+       * doc/sdccman.lyx: renamed --disable-device-lib-build to
+       --disable-device-lib, added --enable-doc, added section VPATH
+
+       * sim/ucsim/configure.in,
+       * sim/ucsim/configure.in: hc08 couldn't be disabled, now hc08 and
+       z80 are enabled by default
+
 2006-04-24 Raphael Neider <rneider AT web.de>
 
        * src/pic/device.c (pic14_assignConfigWordValue): remember assignments to
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index c091772..0000000
--- a/Makefile
+++ /dev/null
@@ -1,232 +0,0 @@
-#
-#
-#
-
-SHELL          = /bin/sh
-
-PRJDIR         = .
-
-include $(PRJDIR)/Makefile.common
-
-SDCC_MISC      = debugger/mcs51 sim/ucsim
-SDCC_LIBS      = support/cpp2 support/makebin
-SDCC_DOC        = doc
-
-# Parts that are not normally compiled but need to be cleaned
-SDCC_EXTRA      = support/regression
-
-SDCC_ASLINK    = as/mcs51 as link as/hc08
-SDCC_PACKIHX   = packihx
-SDCC_LIBRARIAN = support/librarian
-
-TARGETS         = sdcc-libs sdcc-cc sdcc-aslink sdcc-doc
-
-PKGS           = $(SDCC_LIBS) src $(SDCC_ASLINK) $(SDCC_DOC)
-
-ifneq ($(OPT_ENABLE_UCSIM), no)
-TARGETS         += sdcc-misc 
-PKGS            += $(SDCC_MISC)
-endif
-
-ifneq ($(OPT_ENABLE_DEVICE_LIB_BUILD), no)
-TARGETS         += sdcc-device
-PKGS            += device/include device/lib
-endif
-
-ifneq ($(OPT_ENABLE_PACKIHX), no)
-TARGETS         += sdcc-packihx
-PKGS            += $(SDCC_PACKIHX)
-endif
-
-TARGETS         += sdcc-librarian
-PKGS            += $(SDCC_LIBRARIAN)
-
-PKGS_TINI      = $(SDCC_LIBS) $(SDCC_ASLINK) \
-                 src device/include $(SDCC_PACKIHX) $(SDCC_LIBRARIAN)
-PORTS          = $(shell cat ports.build)
-ALLPORTS       = $(shell cat ports.all)
-
-# Compiling entire program or any subproject
-# ------------------------------------------
-all: checkconf sdcc
-
-tini: checkconf sdcc-tini
-
-sdcc-libs:
-       for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done
-
-sdcc-cc: sdcc-libs
-       $(MAKE) -C src
-
-sdcc-aslink:
-       for as in $(SDCC_ASLINK); do $(MAKE) -C $$as; done
-
-sdcc-misc:
-       for misc in $(SDCC_MISC); do $(MAKE) -C $$misc; done
-
-sdcc-packihx:
-       $(MAKE) -C $(SDCC_PACKIHX)
-
-sdcc-librarian:
-       $(MAKE) -C $(SDCC_LIBRARIAN)
-
-sdcc-device: sdcc-cc sdcc-aslink
-       $(MAKE) -C device/include
-       $(MAKE) -C device/lib
-
-sdcc-device-tini:
-       $(MAKE) -C device/include
-       $(MAKE) -C device/lib modelDS390
-
-# Empty for now, as doc depends on latex and latex2html
-sdcc-doc:
-
-sdcc: $(TARGETS)
-
-sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini sdcc-packihx sdcc-librarian
-       $(MAKE) -f main.mk all
-
-# Some interesting sub rules
-sdcc-bin: sdcc-cc sdcc-aslink sdcc-misc
-
-sdcc-base: sdcc-cc sdcc-aslink
-
-# Compiling and installing everything and runing test
-# ---------------------------------------------------
-install:
-       $(MAKE) -f main.mk install
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg install ;\
-       done
-
-install-tini:
-       $(MAKE) -f main.mk install
-       @for pkg in $(PKGS_TINI); do\
-         $(MAKE) -C $$pkg install ;\
-       done
-       $(MAKE) -C device/lib installDS390
-
-
-
-# Deleting all the installed files
-# --------------------------------
-uninstall:
-       $(MAKE) -f main.mk uninstall
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg uninstall ;\
-       done
-
-
-# Deleting all files created by building the program
-# --------------------------------------------------
-clean:
-       @echo "+ Cleaning root of the project..."
-       $(MAKE) -f clean.mk clean
-       @echo "+ Cleaning packages in their directories..."
-       for pkg in $(PKGS); do\
-         $(MAKE) PORTS="$(PORTS)" EXEEXT=$(EXEEXT) -C $$pkg -f clean.mk clean ;\
-       done
-
-# Deleting all files created by configuring or building the program
-# -----------------------------------------------------------------
-distclean:
-       @echo "+ DistCleaning root of the project..."
-       $(MAKE) -f clean.mk distclean
-       @echo "+ DistCleaning packages using clean.mk..."
-       for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) -f clean.mk distclean ;\
-       done
-       for pkg in $(SDCC_EXTRA); do \
-         $(MAKE) -C $$pkg clean; \
-       done
-
-# Like clean but some files may still exist
-# -----------------------------------------
-mostlyclean: clean
-       $(MAKE) -f clean.mk mostlyclean
-       for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" EXEEXT=$(EXEEXT) mostlyclean ;\
-       done
-
-
-# Deleting everything that can reconstructed by this Makefile. It deletes
-# everything deleted by distclean plus files created by bison, stc.
-# -----------------------------------------------------------------------
-realclean: distclean
-       $(MAKE) -f clean.mk realclean
-       for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" EXEEXT=$(EXEEXT) realclean ;\
-       done
-
-
-# Creating distribution
-# ---------------------
-dist: distclean
-       @if [ -f devel ]; then\
-         rm -f devel; mkdist sdcc; touch devel;\
-       else\
-         mkdist sdcc;\
-       fi
-
-
-# Performing self-test
-# --------------------
-check:
-
-
-# Performing installation test
-# ----------------------------
-installcheck:
-
-
-# Creating dependencies
-# ---------------------
-dep:
-       $(MAKE) -f main.mk dep
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg dep ;\
-       done
-
-
-# My rules
-# --------
-newer: distclean
-       @if [ -f start ]; then \
-         tar cvf - \
-           `find . -newer start -type f -print` |\
-         gzip -9c >`date '+%m%d%H%M'`.tgz; \
-       else \
-         echo "start file not found.\n"; \
-         exit 1; \
-       fi
-
-putcopyright:
-       'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
-
-
-# Remaking configuration
-# ----------------------
-configure: configure.in
-       $(SHELL) $(AUTOCONF)
-
-main.mk: $(srcdir)/main_in.mk $(srcdir)/configure.in config.status
-       $(SHELL) ./config.status
-
-Makefiles: makefiles
-
-makefiles: config.status
-
-config.status: configure
-       $(SHELL) ./config.status --recheck
-
-makefiles:
-       $(SHELL) ./config.status
-
-freshconf: main.mk
-
-checkconf:
-       @if [ -f devel ]; then\
-         $(MAKE) freshconf;\
-       fi
-
-# End of Makefile
index ea00cf7f6312f1019dd8d281ee9cea4e238b4f83..5f73360c682764904a39372c9be38a3b7f16b8cc 100644 (file)
@@ -28,7 +28,6 @@ mandir          = @mandir@
 man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
-srcdir          = @srcdir@
 docdir          = @docdir@
 DESTDIR         =
 
@@ -36,11 +35,23 @@ include_dir_suffix = @include_dir_suffix@
 lib_dir_suffix     = @lib_dir_suffix@
 
 # Modules to enable/disable
-OPT_ENABLE_UCSIM = @OPT_ENABLE_UCSIM@
-OPT_ENABLE_DEVICE_LIB_BUILD = @OPT_ENABLE_DEVICE_LIB_BUILD@
-OPT_ENABLE_PACKIHX = @OPT_ENABLE_PACKIHX@
+OPT_DISABLE_AVR   = @OPT_DISABLE_AVR@
+OPT_DISABLE_DS390 = @OPT_DISABLE_DS390@
+OPT_DISABLE_DS400 = @OPT_DISABLE_DS400@
+OPT_DISABLE_HC08  = @OPT_DISABLE_HC08@
+OPT_DISABLE_MCS51 = @OPT_DISABLE_MCS51@
+OPT_DISABLE_PIC   = @OPT_DISABLE_PIC@
+OPT_DISABLE_PIC16 = @OPT_DISABLE_PIC16@
+OPT_DISABLE_XA51  = @OPT_DISABLE_XA51@
+OPT_DISABLE_Z80   = @OPT_DISABLE_Z80@
 
-SLIB                   = $(PRJDIR)/support/Util
+OPT_DISABLE_UCSIM     = @OPT_DISABLE_UCSIM@
+OPT_DISABLE_DEVICE_LIB= @OPT_DISABLE_DEVICE_LIB@
+OPT_DISABLE_PACKIHX   = @OPT_DISABLE_PACKIHX@
+OPT_ENABLE_DOC        = @OPT_ENABLE_DOC@
+OPT_DISABLE_SDCPP     = @OPT_DISABLE_SDCPP@
+
+SLIB                   = $(top_builddir)support/Util
 
 EXEEXT          = @EXEEXT@
 transform       = @program_transform_name@
@@ -48,7 +59,7 @@ transform       = @program_transform_name@
 # Flags
 
 DEFS           += $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS       += $(INCLUDEFLAGS) -I. -I$(PRJDIR) -I$(SLIB)
+CPPFLAGS       += $(INCLUDEFLAGS) -I. -I$(top_builddir) -I$(srcdir)/$(SLIB) -I$(srcdir)
 CFLAGS         += -Wall @CFLAGS@
 LDFLAGS        += @LDFLAGS@
 M_OR_MM         = @M_OR_MM@
diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..8942a69
--- /dev/null
@@ -0,0 +1,256 @@
+#
+#
+#
+
+SHELL          = /bin/sh
+
+VPATH           = @srcdir@
+srcdir          = @srcdir@
+top_builddir    = @top_builddir@
+top_srcdir      = @top_srcdir@
+
+include Makefile.common
+
+SDCC_LIBS      = support/makebin
+SDCC_DOC        = doc
+
+# Parts that are not normally compiled but need to be cleaned
+SDCC_EXTRA      = support/regression
+
+SDCC_PACKIHX   = packihx
+SDCC_LIBRARIAN = support/librarian
+
+ifeq ($(OPT_DISABLE_HC08), 0)
+SDCC_ASLINK     += as/hc08
+endif
+
+ifeq ($(OPT_DISABLE_MCS51), 0)
+SDCC_ASLINK     += as/mcs51
+SDCC_MISC      += debugger/mcs51
+endif
+
+ifeq ($(OPT_DISABLE_Z80), 0)
+SDCC_ASLINK     += as link
+endif
+
+ifeq ($(OPT_DISABLE_UCSIM), 0)
+TARGETS         += sdcc-misc
+SDCC_MISC       += sim/ucsim
+PKGS            += $(SDCC_MISC)
+endif
+
+ifeq ($(OPT_DISABLE_DEVICE_LIB), 0)
+TARGETS         += sdcc-device-lib
+PKGS            += device/lib
+endif
+
+ifeq ($(OPT_DISABLE_PACKIHX), 0)
+TARGETS         += sdcc-packihx
+PKGS            += $(SDCC_PACKIHX)
+endif
+
+ifeq ($(OPT_ENABLE_DOC), 1)
+TARGETS         += sdcc-doc
+PKGS            += $(SDCC_DOC)
+endif
+
+ifeq ($(OPT_DISABLE_SDCPP), 0)
+SDCC_LIBS       += support/cpp2
+endif
+
+TARGETS         += sdcc-libs sdcc-cc sdcc-device-inc sdcc-aslink sdcc-librarian
+
+PKGS           += $(SDCC_LIBS) src device/include $(SDCC_ASLINK) $(SDCC_LIBRARIAN)
+
+PKGS_TINI      = $(SDCC_LIBS) $(SDCC_ASLINK) \
+                 src device/include $(SDCC_PACKIHX) $(SDCC_LIBRARIAN)
+PORTS          = $(shell cat ports.build)
+ALLPORTS       = $(shell cat ports.all)
+
+# Compiling entire program or any subproject
+# ------------------------------------------
+all: checkconf sdcc
+
+tini: checkconf sdcc-tini
+
+sdcc-libs:
+       for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done
+
+sdcc-cc: sdcc-libs
+       $(MAKE) -C src
+
+sdcc-aslink:
+       for as in $(SDCC_ASLINK); do $(MAKE) -C $$as ; done
+
+sdcc-misc:
+       for misc in $(SDCC_MISC); do $(MAKE) -C $$misc ; done
+
+sdcc-packihx:
+       $(MAKE) -C $(SDCC_PACKIHX)
+
+sdcc-librarian:
+       $(MAKE) -C $(SDCC_LIBRARIAN)
+
+sdcc-device-inc:
+       $(MAKE) -C device/include
+
+sdcc-device-lib: sdcc-cc sdcc-aslink
+       $(MAKE) -C device/lib
+
+sdcc-device-tini:
+       $(MAKE) -C device/include
+       $(MAKE) -C device/lib modelDS390
+
+# doc depends on latex and latex2html
+sdcc-doc:
+       $(MAKE) -C doc
+
+sdcc: $(TARGETS)
+
+sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini sdcc-packihx sdcc-librarian
+       $(MAKE) -f main.mk all
+
+# Some interesting sub rules
+sdcc-bin: sdcc-cc sdcc-aslink sdcc-misc
+
+sdcc-base: sdcc-cc sdcc-aslink
+
+# Compiling and installing everything and runing test
+# ---------------------------------------------------
+install:
+       $(MAKE) -f main.mk install
+       @for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg install ;\
+       done
+
+install-tini:
+       $(MAKE) -f main.mk install
+       @for pkg in $(PKGS_TINI); do\
+         $(MAKE) -C $$pkg install ;\
+       done
+       $(MAKE) -C device/lib installDS390
+
+
+
+# Deleting all the installed files
+# --------------------------------
+uninstall:
+       $(MAKE) -f main.mk uninstall
+       @for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg uninstall ;\
+       done
+
+
+# Deleting all files created by building the program
+# --------------------------------------------------
+clean:
+       @echo "+ Cleaning root of the project..."
+       $(MAKE) -f $(srcdir)/clean.mk clean
+       @echo "+ Cleaning packages in their directories..."
+       for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) clean ;\
+       done
+
+# Deleting all files created by configuring or building the program
+# -----------------------------------------------------------------
+distclean:
+       @echo "+ DistCleaning packages using clean.mk..."
+       for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) distclean ;\
+       done
+       for pkg in $(SDCC_EXTRA); do \
+         $(MAKE) -C $$pkg distclean; \
+       done
+       @echo "+ DistCleaning root of the project..."
+       $(MAKE) -f $(srcdir)/clean.mk distclean
+
+# Like clean but some files may still exist
+# -----------------------------------------
+mostlyclean: clean
+       $(MAKE) -f $(srcdir)/clean.mk mostlyclean
+       for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) mostlyclean ;\
+       done
+
+
+# Deleting everything that can reconstructed by this Makefile. It deletes
+# everything deleted by distclean plus files created by bison, stc.
+# -----------------------------------------------------------------------
+realclean: distclean
+       $(MAKE) -f $(srcdir)/clean.mk realclean
+       for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) realclean ;\
+       done
+
+
+# Creating distribution
+# ---------------------
+dist: distclean
+       @if [ -f devel ]; then\
+         rm -f devel; mkdist sdcc; touch devel;\
+       else\
+         mkdist sdcc;\
+       fi
+
+
+# Performing self-test
+# --------------------
+check:
+
+
+# Performing installation test
+# ----------------------------
+installcheck:
+
+
+# Creating dependencies
+# ---------------------
+dep:
+       $(MAKE) -f main.mk dep
+       @for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg dep ;\
+       done
+
+
+# My rules
+# --------
+newer: distclean
+       @if [ -f start ]; then \
+         tar cvf - \
+           `find . -newer start -type f -print` |\
+         gzip -9c >`date '+%m%d%H%M'`.tgz; \
+       else \
+         echo "start file not found.\n"; \
+         exit 1; \
+       fi
+
+putcopyright:
+       'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
+
+
+# Remaking configuration
+# ----------------------
+configure: configure.in
+       $(SHELL) $(AUTOCONF)
+
+main.mk: $(srcdir)/main_in.mk $(srcdir)/configure.in config.status
+       $(SHELL) ./config.status
+
+Makefiles: makefiles
+
+makefiles: config.status
+
+config.status: configure
+       $(SHELL) ./config.status --recheck
+
+makefiles:
+       $(SHELL) ./config.status
+
+freshconf: main.mk
+
+checkconf:
+       @if [ -f devel ]; then\
+         $(MAKE) freshconf;\
+       fi
+
+# End of Makefile
diff --git a/as/Makefile b/as/Makefile
deleted file mode 100644 (file)
index a2b8623..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-PRJDIR = ..
-BUILDDIR=../../bin
-include $(PRJDIR)/Makefile.common
-
-PORTS = z80 gbz80 hc08
-DOCS = README abstra.doc appendk.txt asmlnk.doc asxhtm.html format.txt
-
-all:
-       $(MAKE) -C z80 _as-z80 _as-gbz80 E=$(E) BUILDDIR=$(BUILDDIR)
-       $(MAKE) -C hc08 all E=$(E) BUILDDIR=$(BUILDDIR)
-
-install: all install-doc
-       $(INSTALL) $(PRJDIR)/bin/as-z80$(EXEEXT) `echo $(DESTDIR)$(bindir)/as-z80$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(DESTDIR)$(bindir)/as-z80$(EXEEXT)|sed '$(transform)'`
-       $(INSTALL) $(PRJDIR)/bin/as-gbz80$(EXEEXT) `echo $(DESTDIR)$(bindir)/as-gbz80$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(DESTDIR)$(bindir)/as-gbz80$(EXEEXT)|sed '$(transform)'`
-       $(INSTALL) $(PRJDIR)/bin/as-hc08$(EXEEXT) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
-
-install-doc:
-       $(INSTALL) -d $(DESTDIR)$(docdir)/aslink
-       cp -f doc/* $(DESTDIR)$(docdir)/aslink
-
-uninstall:
-       cd $(DESTDIR)$(bindir); rm -f as-z80$(EXEEXT) as-gbz80$(EXEEXT) as-hc08$(EXEEXT)
-
-include clean.mk
diff --git a/as/Makefile.in b/as/Makefile.in
new file mode 100644 (file)
index 0000000..74dbf20
--- /dev/null
@@ -0,0 +1,29 @@
+# This Makefile is only for z80 and gbz80
+
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+
+BUILDDIR=../$(top_builddir)bin
+include $(top_builddir)Makefile.common
+
+PORTS = z80 gbz80
+DOCS = README abstra.doc appendk.txt asmlnk.doc asxhtm.html format.txt
+
+all:
+       $(MAKE) -C z80 _as-z80 _as-gbz80 E=$(E) BUILDDIR=$(BUILDDIR)
+
+install: all install-doc
+       $(INSTALL) $(top_builddir)bin/as-z80$(EXEEXT) `echo $(DESTDIR)$(bindir)/as-z80$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/as-z80$(EXEEXT)|sed '$(transform)'`
+       $(INSTALL) $(top_builddir)bin/as-gbz80$(EXEEXT) `echo $(DESTDIR)$(bindir)/as-gbz80$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/as-gbz80$(EXEEXT)|sed '$(transform)'`
+
+install-doc:
+       $(INSTALL) -d $(DESTDIR)$(docdir)/aslink
+       cd $(srcdir)/doc; cp -f $(DOCS) $(DESTDIR)$(docdir)/aslink
+
+uninstall:
+       cd $(DESTDIR)$(bindir); rm -f as-z80$(EXEEXT) as-gbz80$(EXEEXT)
+
+include $(srcdir)/clean.mk
index 55d0fc80df3157c6ab85e7614dcd0572bb60f1ee..ee9489dbff8fdadd34c9b304aebbb502128231c9 100644 (file)
@@ -1,6 +1,6 @@
 clean:
-       $(MAKE) -C z80 -f clean.mk clean BUILDDIR=$(BUILDDIR)
+       $(MAKE) -C z80 clean BUILDDIR=$(BUILDDIR)
 
 distclean:
-       $(MAKE) -C z80 -f clean.mk distclean BUILDDIR=$(BUILDDIR)
-
+       $(MAKE) -C z80 distclean BUILDDIR=$(BUILDDIR)
+       rm -f Makefile
index 675a6f84a8c7a9234f5437dd49fec14488e3aff0..799da3d321e1fe44bf517621a0a00c91c0409c18 100644 (file)
@@ -13,7 +13,8 @@ CPP           = @CPP@
 INSTALL                = @INSTALL@
 STRIP           = @STRIP@
 
-PRJDIR         = ../..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 srcdir         = @srcdir@
 prefix         = @prefix@
@@ -29,7 +30,9 @@ infodir         = @info@
 
 EXEEXT          = @EXEEXT@
 
-CPPFLAGS       = @CPPFLAGS@ -I. -I$(PRJDIR)
+VPATH           = @srcdir@
+
+CPPFLAGS       = @CPPFLAGS@ -I. -I$(srcdir)
 CFLAGS         = @CFLAGS@ -Wall
 M_OR_MM                = @M_OR_MM@
 LDFLAGS                = @LDFLAGS@
@@ -45,8 +48,8 @@ LKOBJECTS     = lkmain.o lkhead.o lkarea.o lkdata.o \
                  lkstore.o lknoice.o lkmem.o lkaomf51.o strcmpi.o
 LKSOURCES      = $(patsubst %.o,%.c,$(LKOBJECTS))
 
-ASHC08         = $(PRJDIR)/bin/as-hc08$(EXEEXT)
-ASLINK         = $(PRJDIR)/bin/link-hc08$(EXEEXT)
+ASHC08         = $(top_builddir)bin/as-hc08$(EXEEXT)
+ASLINK         = $(top_builddir)bin/link-hc08$(EXEEXT)
 
 transform       = @program_transform_name@
 
@@ -94,11 +97,14 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: $(ASSOURCES) $(LKSOURCES) *.h $(PRJDIR)/*.h
-       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(ASSOURCES) $(LKSOURCES) >Makefile.dep
+Makefile.dep: $(ASSOURCES) $(LKSOURCES) $(srcdir)/*.h $(top_builddir)*.h $(top_srcdir)/*.h
+       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
 
-include Makefile.dep
-include clean.mk
+ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
+                                   clean distclean mostlyclean realclean)" ""
+  include Makefile.dep
+endif
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
@@ -109,8 +115,8 @@ include clean.mk
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-          $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+          $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
         fi
 
 # End of Makefile
index 27e35fa63a483e5b148cb53904b4b6f59481c929..6b47bf1cea51f3eb21ed8d902032618667d6194c 100644 (file)
@@ -1,12 +1,11 @@
 # Deleting all files created by building the program
 # --------------------------------------------------
-include ../../Makefile.common
-PRJDIR = ../..
+include $(top_builddir)Makefile.common
 
 clean:
        rm -f *core *[%~] *.[oa]
        rm -f .[a-z]*~
-       rm -f $(PRJDIR)/bin/as-hc08$(EXEEXT) $(PRJDIR)/bin/link-hc08$(EXEEXT) as-hc08$(EXEEXT) link-hc08$(EXEEXT)
+       rm -f $(top_builddir)bin/as-hc08$(EXEEXT) $(top_builddir)bin/link-hc08$(EXEEXT) as-hc08$(EXEEXT) link-hc08$(EXEEXT)
 
 
 # Deleting all files created by configuring or building the program
index 879e9bc8ad388e192c0c0849fde78cd7cba43a4f..ac65f24e50330b37d67254e462848ec49ec1d299 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of conf.mk
index 7b0a204d4c63223da99d36259390a0e29cc94992..3511edcb45003ae21ede427352fcdcf7adbb32e2 100644 (file)
@@ -13,7 +13,8 @@ CPP           = @CPP@
 INSTALL                = @INSTALL@
 STRIP           = @STRIP@
 
-PRJDIR         = ../..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 srcdir         = @srcdir@
 prefix         = @prefix@
@@ -29,7 +30,9 @@ infodir         = @info@
 
 EXEEXT          = @EXEEXT@
 
-CPPFLAGS       = @CPPFLAGS@ -I. -I$(PRJDIR)
+VPATH           = @srcdir@
+
+CPPFLAGS       = @CPPFLAGS@ -I. -I$(srcdir)
 CFLAGS         = @CFLAGS@ -Wall -DINDEXLIB
 M_OR_MM                = @M_OR_MM@
 LDFLAGS                = @LDFLAGS@
@@ -45,8 +48,8 @@ LKOBJECTS     = lkmain.o lkhead.o lkarea.o lkdata.o \
                  lkstore.o lknoice.o lkmem.o lkaomf51.o strcmpi.o
 LKSOURCES      = $(patsubst %.o,%.c,$(LKOBJECTS))
 
-ASX8051                = $(PRJDIR)/bin/asx8051$(EXEEXT)
-ASLINK         = $(PRJDIR)/bin/aslink$(EXEEXT)
+ASX8051                = $(top_builddir)bin/asx8051$(EXEEXT)
+ASLINK         = $(top_builddir)bin/aslink$(EXEEXT)
 
 transform       = @program_transform_name@
 
@@ -94,11 +97,14 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: $(ASSOURCES) $(LKSOURCES) *.h $(PRJDIR)/*.h
-       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(ASSOURCES) $(LKSOURCES) >Makefile.dep
+Makefile.dep: $(ASSOURCES) $(LKSOURCES) $(srcdir)/*.h $(top_builddir)*.h $(top_srcdir)/*.h
+       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
 
-include Makefile.dep
-include clean.mk
+ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
+                                   clean distclean mostlyclean realclean)" ""
+  include Makefile.dep
+endif
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
@@ -109,8 +115,8 @@ include clean.mk
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-          $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+          $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
         fi
 
 # End of Makefile
index a447881531e465f2fdb7d7271f95f6d7a436ba9f..829d06942953889e3cb7ae41f405f07baeb890fa 100644 (file)
@@ -1,12 +1,11 @@
 # Deleting all files created by building the program
 # --------------------------------------------------
-include ../../Makefile.common
-PRJDIR = ../..
+include $(top_builddir)Makefile.common
 
 clean:
        rm -f *core *[%~] *.[oa]
        rm -f .[a-z]*~
-       rm -f $(PRJDIR)/bin/asx8051$(EXEEXT) $(PRJDIR)/bin/aslink$(EXEEXT) asx8051$(EXEEXT) aslink$(EXEEXT)
+       rm -f $(top_builddir)bin/asx8051$(EXEEXT) $(top_builddir)bin/aslink$(EXEEXT) asx8051$(EXEEXT) aslink$(EXEEXT)
 
 
 # Deleting all files created by configuring or building the program
index 879e9bc8ad388e192c0c0849fde78cd7cba43a4f..e0e34319dc55eba4252c03889fb752eb86f8a4ae 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_prjdir) && $(SHELL) ./config.status
 
 # End of conf.mk
diff --git a/as/xa51/Makefile b/as/xa51/Makefile
deleted file mode 100644 (file)
index 46d7883..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-CC = gcc
-CFLAGS = -ggdb -Wall
-YACC = bison -y -d
-LEX = flex -i
-LEXLIB = 
-
-all: xa_rasm xa_link
-
-OBJECTS = xa_main.o xa_rasm.tab.o xa_rasm.lex.o  
-
-xa_rasm: $(OBJECTS)
-       $(CC) -o xa_rasm $(OBJECTS) $(LEXLIB)
-       #strip xa_rasm
-
-xa_rasm.lex.o: xa_rasm.lex.c xa_rasm.tab.h xa_main.h
-       $(CC) $(CFLAGS) -c xa_rasm.lex.c
-
-xa_rasm.tab.o: xa_rasm.tab.c xa_rasm.tab.h xa_main.h
-       $(CC) $(CFLAGS) -c xa_rasm.tab.c
-
-xa_main.o: xa_main.c xa_main.h xa_version.h
-       $(CC) $(CFLAGS) -Wall -c xa_main.c
-
-xa_link.o: xa_link.c xa_main.h xa_version.h
-       $(CC) $(CFLAGS) -Wall -c xa_link.c
-
-xa_rasm.tab.c xa_rasm.tab.h: xa_rasm.y
-       $(YACC) xa_rasm.y
-       mv y.tab.c xa_rasm.tab.c
-       mv y.tab.h xa_rasm.tab.h
-
-xa_rasm.lex.c: xa_rasm.l
-       $(LEX) xa_rasm.l
-       mv lex.yy.c xa_rasm.lex.c
-
-all: xa_rasm
-
-clean:
-       rm -f *.tab.c *.tab.h *.lex.c *.o *.bak y.output *.hex *.lst *.obj
-       rm -f xa_rasm xa_link core *~
-
diff --git a/as/xa51/Makefile.in b/as/xa51/Makefile.in
new file mode 100644 (file)
index 0000000..87c4756
--- /dev/null
@@ -0,0 +1,43 @@
+VPATH = @srcdir@
+
+CC = gcc
+CFLAGS = -ggdb -Wall
+YACC = bison -y -d
+LEX = flex -i
+LEXLIB = 
+
+all: xa_rasm xa_link
+
+OBJECTS = xa_main.o xa_rasm.tab.o xa_rasm.lex.o  
+
+xa_rasm: $(OBJECTS)
+       $(CC) -o xa_rasm $(OBJECTS) $(LEXLIB)
+       #strip xa_rasm
+
+xa_rasm.lex.o: xa_rasm.lex.c xa_rasm.tab.h xa_main.h
+       $(CC) $(CFLAGS) -c xa_rasm.lex.c
+
+xa_rasm.tab.o: xa_rasm.tab.c xa_rasm.tab.h xa_main.h
+       $(CC) $(CFLAGS) -c xa_rasm.tab.c
+
+xa_main.o: xa_main.c xa_main.h xa_version.h
+       $(CC) $(CFLAGS) -Wall -c xa_main.c
+
+xa_link.o: xa_link.c xa_main.h xa_version.h
+       $(CC) $(CFLAGS) -Wall -c xa_link.c
+
+xa_rasm.tab.c xa_rasm.tab.h: xa_rasm.y
+       $(YACC) xa_rasm.y
+       mv y.tab.c xa_rasm.tab.c
+       mv y.tab.h xa_rasm.tab.h
+
+xa_rasm.lex.c: xa_rasm.l
+       $(LEX) xa_rasm.l
+       mv lex.yy.c xa_rasm.lex.c
+
+all: xa_rasm
+
+clean:
+       rm -f *.tab.c *.tab.h *.lex.c *.o *.bak y.output *.hex *.lst *.obj
+       rm -f xa_rasm xa_link core *~
+
index 50d70befbe5c11eed04a89d7f09ad236e68c2f79..56c788f86c0aaac8eaf7ffe07f39debcb7a31f45 100644 (file)
@@ -1,97 +1,66 @@
-#
-#
-#
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
 
-VERSION         = @VERSION@
-VERSIONHI       = @VERSIONHI@
-VERSIONLO       = @VERSIONLO@
-VERSIONP        = @VERSIONP@
+include $(top_builddir)Makefile.common
 
-SHELL          = /bin/sh
-CC             = @CC@
-CPP            = @CPP@
-INSTALL                = @INSTALL@
+OBJDIR = obj/$(EXT)
 
-PRJDIR         = ../..
+SDC    = .
 
-srcdir         = @srcdir@
-prefix         = @prefix@
-exec_prefix     = @exec_prefix@
-bindir          = @bindir@
-libdir          = @libdir@
-datadir         = @datadir@
-includedir      = @include@
-mandir          = @mandir@
-man1dir         = $(mandir)/man1
-man2dir         = $(mandir)/man2
-infodir         = @infodir@
+SLIBSRC        = NewAlloc.c
 
-CPPFLAGS       = @CPPFLAGS@ -I. -I$(PRJDIR)
-CFLAGS         = @CFLAGS@ -Wall -DINDEXLIB -DMLH_MAP -DUNIX -DSDK -funsigned-char -ggdb
-M_OR_MM                = @M_OR_MM@
-LDFLAGS                = @LDFLAGS@ -lm
+SRC    = asdata.c asexpr.c aslex.c aslist.c asmain.c asout.c \
+         assubr.c assym.c z80adr.c z80ext.c z80mch.c z80pst.c
 
-ASOBJECTS      = asdata.o asexpr.o aslex.o aslist.o asmain.o asout.o \
-                 assubr.o assym.o z80adr.o z80ext.o z80mch.o z80pst.o  
-ASSOURCES      = $(patsubst %.o,%.c,$(ASOBJECTS))
+OBJS   = $(SRC:%.c=$(OBJDIR)/%.o)
+SLIBOBJS       = $(SLIBSRC:%.c=$(OBJDIR)/%.o) 
 
-ASXZ80         = $(PRJDIR)/bin/as-z80
+BINS   = $(BUILDDIR)/as$(EXT)$(EXEEXT)
 
-# Compiling entire program or any subproject
-# ------------------------------------------
-all: checkconf $(ASXZ80)
+CFLAGS += $(CPPFLAGS) $(OPTS) -I. -DINDEXLIB -DMLH_MAP -DUNIX -DSDK
+CFLAGS += -funsigned-char
+CFLAGS += -I$(SLIB) 
 
-$(ASXZ80): $(ASOBJECTS)
-       $(CC) $(CFLAGS) -o $@ $(ASOBJECTS) $(LDFLAGS)
+LDFLAGS += -lm $(EXTRALIBS)
 
-# Compiling and installing everything and runing test
-# ---------------------------------------------------
-install: all installdirs
-       $(INSTALL) $(ASXZ80) $(DESTDIR)$(bindir)/as-z80
-
-# Deleting all the installed files
-# --------------------------------
-uninstall:
-       rm -f $(DESTDIR)$(bindir)/as-z80
-
-
-# Performing self-test
-# --------------------
-check:
+all:   dep $(BINS)
 
+dep: Makefile.dep
 
-# Performing installation test
-# ----------------------------
-installcheck:
+Makefile.dep: $(SRC) $(srcdir)/*.h
+       $(CPP) $(CPPFLAGS) $(M_OR_MM) $^ > Makefile.dep
 
+ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
+                                   clean distclean mostlyclean realclean)" ""
+  include Makefile.dep
+endif
 
-# Creating installation directories
-# ---------------------------------
-installdirs:
-       $(INSTALL) -d $(DESTDIR)$(bindir)
+# We need a '.stamp'-file in $(OBJDIR), because the time stamp
+# of $(OBJDIR) itself is always updated, when a file in $(OBJDIR)
+# is updated. A rule like
+#      $(OBJDIR)/anyfile: $(OBJDIR)
+# will always force a remake (at least on Linux ext2).
 
+$(OBJDIR)/.stamp:
+       mkdir -p $(OBJDIR)
+       touch $(OBJDIR)/.stamp
 
-# Creating dependencies
-# ---------------------
-dep: Makefile.dep
+$(BINS): $(OBJS) $(SLIBOBJS)
+       $(CC) -o $(BINS) $(OBJS) $(SLIBOBJS) $(LDFLAGS)
 
-Makefile.dep: $(ASSOURCES) *.h $(PRJDIR)/*.h
-       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(ASSOURCES) >Makefile.dep
 
-include Makefile.dep
-include clean.mk
+$(OBJDIR)/%.o: %.c $(OBJDIR)/.stamp
+       $(CC) -c $(CFLAGS) -o $@ $<
 
-# My rules
-# --------
-.c.o:
-       $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+$(OBJDIR)/%.o: $(SLIB)/%.c $(OBJDIR)/.stamp
+       $(CC) -c $(CFLAGS) -o $@ $<
 
+_as-z80:
+       $(MAKE) EXT=-z80$(E)
 
-# Remaking configuration
-# ----------------------
-checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-          $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
-        fi
+_as-gbz80:
+       $(MAKE) EXT=-gbz80$(E) OPTS=-DGAMEBOY
 
-# End of Makefile
+include $(srcdir)/clean.mk
index cf18deed5150603bc0f63c16b4fd8ddca81357df..579a48e57f0d62425fc9ac552844ab82edabadc2 100644 (file)
@@ -1,18 +1,18 @@
 # Deleting all files created by building the program
 # --------------------------------------------------
-include ../../Makefile.common
+include $(top_builddir)Makefile.common
 
 clean:
        rm -rf obj
        rm -f *core *[%~] *.[oa]
        rm -f .[a-z]*~
-       rm -f $(BUILDDIR)/as-z80$(EXEEXT)   as-z80$(EXEEXT)
-       rm -f $(BUILDDIR)/as-gbz80$(EXEEXT) as-gbz80$(EXEEXT)
+       rm -f $(top_builddir)bin/as-z80$(EXEEXT)   as-z80$(EXEEXT)
+       rm -f $(top_builddir)bin/as-gbz80$(EXEEXT) as-gbz80$(EXEEXT)
 
 # Deleting all files created by configuring or building the program
 # -----------------------------------------------------------------
 distclean: clean
-       rm -f *.dep
+       rm -f Makefile *.dep
 
 
 # Like clean but some files may still exist
index 524efe65a45ad17563d397836b82db59f3fe69c8..e677a9c294682b5b4d81f48656dd86914d8f0ebe 100644 (file)
@@ -3,7 +3,7 @@
 clean:
        rm -f *core *[%~] *.[oa]
        rm -f .[a-z]*~
-       rm -f $(PRJDIR)/as-z80 as-z80
+       rm -f $(top_builddir)bin/as-z80 as-z80
 
 
 # Deleting all files created by configuring or building the program
index 6ccdb05b1b072e76d771c7e31c14140960d27fae..bd9f607d2f9d92ffc3b930432b85628c7c15177d 100644 (file)
--- a/clean.mk
+++ b/clean.mk
@@ -8,7 +8,7 @@ clean:
 # Deleting all files created by configuring or building the program
 # -----------------------------------------------------------------
 distclean: clean
-       rm -f config.cache config.log config.status Makefile.common
+       rm -f config.cache config.log config.status Makefile Makefile.common
        rm -f sdccconf.h main.mk *.dep
        rm -f ports.all ports.build
 
index a2ae07d3b8d890febf50dcb7871733601591e53a..0f73bad4fe93c58afdf9289ae8f9bfaacccdbec5 100755 (executable)
--- a/configure
+++ b/configure
@@ -271,7 +271,7 @@ PACKAGE_VERSION=
 PACKAGE_STRING=
 PACKAGE_BUGREPORT=
 
-ac_unique_file="Makefile"
+ac_unique_file="Makefile.in"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
@@ -312,9 +312,9 @@ ac_includes_default="\
 ac_subdirs_all="$ac_subdirs_all support/cpp2"
 ac_subdirs_all="$ac_subdirs_all packihx"
 ac_subdirs_all="$ac_subdirs_all sim/ucsim"
-ac_subdirs_all="$ac_subdirs_all device/lib/pic16"
 ac_subdirs_all="$ac_subdirs_all device/lib/pic"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS AWK VERSION VERSIONHI VERSIONLO VERSIONP CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB LEX LEXLIB LEX_OUTPUT_ROOT YACC AUTOCONF STRIP AS CP LYX LATEX LATEX2HTML PDFLATEX DVIPDF EGREP M_OR_MM sdccconf_h_dir_separator include_dir_suffix lib_dir_suffix docdir OPT_ENABLE_UCSIM OPT_ENABLE_DEVICE_LIB_BUILD OPT_ENABLE_PACKIHX subdirs LIBOBJS LTLIBOBJS'
+ac_subdirs_all="$ac_subdirs_all device/lib/pic16"
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS AWK VERSION VERSIONHI VERSIONLO VERSIONP CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB LEX LEXLIB LEX_OUTPUT_ROOT YACC AUTOCONF STRIP AS CP EGREP M_OR_MM sdccconf_h_dir_separator include_dir_suffix lib_dir_suffix docdir OPT_DISABLE_MCS51 OPT_DISABLE_GBZ80 OPT_DISABLE_Z80 OPT_DISABLE_AVR OPT_DISABLE_DS390 OPT_DISABLE_DS400 OPT_DISABLE_PIC OPT_DISABLE_PIC16 OPT_DISABLE_XA51 OPT_DISABLE_HC08 OPT_DISABLE_UCSIM OPT_DISABLE_DEVICE_LIB OPT_DISABLE_PACKIHX OPT_DISABLE_SDCPP OPT_ENABLE_DOC LYX LATEX LATEX2HTML PDFLATEX DVIPDF DVIPS MAKEINDEX OPT_ENABLE_LIBGC subdirs LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -881,13 +881,14 @@ Optional Features:
   --disable-ds390-port    Excludes the DS390 port
   --disable-ds400-port    Excludes the DS400 port
   --disable-pic-port      Excludes the PIC port
-  --disable-pic16-port    Excludes the PIC port
+  --disable-pic16-port    Excludes the PIC16 port
   --disable-xa51-port     Excludes the XA51 port
   --disable-hc08-port     Excludes the HC08 port
   --disable-ucsim         Disables configuring and building of ucsim
-  --disable-device-lib-build
-                          Disables automatically building device libraries
+  --disable-device-lib    Disables building device libraries
   --disable-packihx       Disables building packihx
+  --disable-sdcpp         Disables building sdcpp
+  --enable-doc            Enables building the documentation
   --enable-libgc          Use the Bohem memory allocator. Lower runtime
                           footprint.
 
@@ -1394,8 +1395,8 @@ done
 
 echo "$as_me:$LINENO: checking version of the package" >&5
 echo $ECHO_N "checking version of the package... $ECHO_C" >&6
-if test -f .version; then
-  VERSION=`cat .version`
+if test -f ${srcdir}/.version; then
+  VERSION=`cat ${srcdir}/.version`
 elif test -f ../.version; then
   VERSION=`cat ../.version`
 else
@@ -3612,187 +3613,6 @@ echo "${ECHO_T}no" >&6
 fi
 
 
-# Extract the first word of "lyx", so it can be a program name with args.
-set dummy lyx; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LYX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$LYX"; then
-  ac_cv_prog_LYX="$LYX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LYX="lyx"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_LYX" && ac_cv_prog_LYX=":"
-fi
-fi
-LYX=$ac_cv_prog_LYX
-if test -n "$LYX"; then
-  echo "$as_me:$LINENO: result: $LYX" >&5
-echo "${ECHO_T}$LYX" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-# Extract the first word of "latex", so it can be a program name with args.
-set dummy latex; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LATEX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$LATEX"; then
-  ac_cv_prog_LATEX="$LATEX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LATEX="latex"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_LATEX" && ac_cv_prog_LATEX=":"
-fi
-fi
-LATEX=$ac_cv_prog_LATEX
-if test -n "$LATEX"; then
-  echo "$as_me:$LINENO: result: $LATEX" >&5
-echo "${ECHO_T}$LATEX" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-# Extract the first word of "latex2html", so it can be a program name with args.
-set dummy latex2html; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LATEX2HTML+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$LATEX2HTML"; then
-  ac_cv_prog_LATEX2HTML="$LATEX2HTML" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LATEX2HTML="latex2html"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_LATEX2HTML" && ac_cv_prog_LATEX2HTML=":"
-fi
-fi
-LATEX2HTML=$ac_cv_prog_LATEX2HTML
-if test -n "$LATEX2HTML"; then
-  echo "$as_me:$LINENO: result: $LATEX2HTML" >&5
-echo "${ECHO_T}$LATEX2HTML" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-# Extract the first word of "pdflatex", so it can be a program name with args.
-set dummy pdflatex; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_PDFLATEX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$PDFLATEX"; then
-  ac_cv_prog_PDFLATEX="$PDFLATEX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_PDFLATEX="pdflatex"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_PDFLATEX" && ac_cv_prog_PDFLATEX=":"
-fi
-fi
-PDFLATEX=$ac_cv_prog_PDFLATEX
-if test -n "$PDFLATEX"; then
-  echo "$as_me:$LINENO: result: $PDFLATEX" >&5
-echo "${ECHO_T}$PDFLATEX" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-# Extract the first word of "dvipdf", so it can be a program name with args.
-set dummy dvipdf; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_DVIPDF+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$DVIPDF"; then
-  ac_cv_prog_DVIPDF="$DVIPDF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DVIPDF="dvipdf"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_DVIPDF" && ac_cv_prog_DVIPDF=":"
-fi
-fi
-DVIPDF=$ac_cv_prog_DVIPDF
-if test -n "$DVIPDF"; then
-  echo "$as_me:$LINENO: result: $DVIPDF" >&5
-echo "${ECHO_T}$DVIPDF" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-
 
 
 if test "$YACC" = ":"; then
@@ -4590,7 +4410,7 @@ done
 # Macro definitions
 # ===========================================================================
 
-# DD_COPT macro checks if the compiler specified as the 1st parameter
+# adl_DD_COPT macro checks if the compiler specified as the 1st parameter
 # supports option specified as the 2nd parameter
 # For example: DD_CPORT(CXX, fPIC)
 
@@ -4603,7 +4423,7 @@ done
 #
 # Examples:
 #
-#  AC_EXPAND(prefix, "/usr/local", expanded_prefix)
+#  adl_EXPAND(prefix, "/usr/local", expanded_prefix)
 
 
 
@@ -4654,7 +4474,6 @@ done
 
 
 
-# AC_NORMALIZE_DEFINE_UNQUOTED(var, DEFINE, REFERENCE_STRING)
 
 
 
@@ -6756,7 +6575,7 @@ esac
 # The variables in the header are replaced by AC_*DEFINE*()
 # sdccconf_h_dir_separator contains a backslash.
 
-if test "${sdccconf_h_dir_separator}" = ""; then
+if test "x${sdccconf_h_dir_separator}" = "x"; then
     sdccconf_h_dir_separator="/"
 fi
 
@@ -6815,24 +6634,15 @@ _ACEOF
 
   ac_ndu=$expanded_prefix
   case ":$ac_ndu:" in
-# change empty paths to '.'
   ::) ac_ndu='.' ;;
-# strip trailing slashes
   :*[\\/]:) ac_ndu=`echo "$ac_ndu" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case $sdccconf_h_dir_separator in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) ac_ndu=`echo "[$]ac_ndu" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   cat >>confdefs.h <<_ACEOF
@@ -6854,24 +6664,15 @@ _ACEOF
 
   ac_ndu=$expanded_exec_prefix
   case ":$ac_ndu:" in
-# change empty paths to '.'
   ::) ac_ndu='.' ;;
-# strip trailing slashes
   :*[\\/]:) ac_ndu=`echo "$ac_ndu" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case $sdccconf_h_dir_separator in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) ac_ndu=`echo "[$]ac_ndu" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   cat >>confdefs.h <<_ACEOF
@@ -6893,24 +6694,15 @@ _ACEOF
 
   ac_ndu=$expanded_bindir
   case ":$ac_ndu:" in
-# change empty paths to '.'
   ::) ac_ndu='.' ;;
-# strip trailing slashes
   :*[\\/]:) ac_ndu=`echo "$ac_ndu" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case $sdccconf_h_dir_separator in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) ac_ndu=`echo "[$]ac_ndu" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   cat >>confdefs.h <<_ACEOF
@@ -6932,24 +6724,15 @@ _ACEOF
 
   ac_ndu=$expanded_datadir
   case ":$ac_ndu:" in
-# change empty paths to '.'
   ::) ac_ndu='.' ;;
-# strip trailing slashes
   :*[\\/]:) ac_ndu=`echo "$ac_ndu" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case $sdccconf_h_dir_separator in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) ac_ndu=`echo "[$]ac_ndu" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   cat >>confdefs.h <<_ACEOF
@@ -6961,24 +6744,15 @@ _ACEOF
 # include/lib suffix
 norm_inc_dir_suffix=${include_dir_suffix}
 case ":$norm_inc_dir_suffix:" in
-# change empty paths to '.'
   ::) norm_inc_dir_suffix='.' ;;
-# strip trailing slashes
   :*[\\/]:) norm_inc_dir_suffix=`echo "$norm_inc_dir_suffix" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case $sdccconf_h_dir_separator in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) norm_inc_dir_suffix=`echo "[$]norm_inc_dir_suffix" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) norm_inc_dir_suffix=`echo "$norm_inc_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) norm_inc_dir_suffix=`echo "$norm_inc_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) norm_inc_dir_suffix=`echo "$norm_inc_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
 cat >>confdefs.h <<_ACEOF
@@ -6987,24 +6761,15 @@ _ACEOF
 
 norm_lib_dir_suffix=${lib_dir_suffix}
 case ":$norm_lib_dir_suffix:" in
-# change empty paths to '.'
   ::) norm_lib_dir_suffix='.' ;;
-# strip trailing slashes
   :*[\\/]:) norm_lib_dir_suffix=`echo "$norm_lib_dir_suffix" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case $sdccconf_h_dir_separator in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) norm_lib_dir_suffix=`echo "[$]norm_lib_dir_suffix" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) norm_lib_dir_suffix=`echo "$norm_lib_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) norm_lib_dir_suffix=`echo "$norm_lib_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) norm_lib_dir_suffix=`echo "$norm_lib_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
 cat >>confdefs.h <<_ACEOF
@@ -7037,45 +6802,27 @@ _lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
      echo "$_lcl_receval")`
   _lcl_notation="$_lcl_from$_lcl_to"
   case ":$_lcl_from:" in
-# change empty paths to '.'
   ::) _lcl_from='.' ;;
-# strip trailing slashes
   :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case '/' in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) _lcl_from=`echo "[$]_lcl_from" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   case ":$_lcl_to:" in
-# change empty paths to '.'
   ::) _lcl_to='.' ;;
-# strip trailing slashes
   :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case '/' in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) _lcl_to=`echo "[$]_lcl_to" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   _lcl_common_prefix=''
@@ -7104,47 +6851,29 @@ done
 _lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"`
 _lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix"
   case ":$_lcl_result_tmp:" in
-# change empty paths to '.'
   ::) _lcl_result_tmp='.' ;;
-# strip trailing slashes
   :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case "$_lcl_notation" in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) _lcl_result_tmp=`echo "[$]_lcl_result_tmp" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   eval $_lcl_result_var='$_lcl_result_tmp'
 done
 case ":$bin2data_dir:" in
-# change empty paths to '.'
   ::) bin2data_dir='.' ;;
-# strip trailing slashes
   :*[\\/]:) bin2data_dir=`echo "$bin2data_dir" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case $sdccconf_h_dir_separator in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) bin2data_dir=`echo "[$]bin2data_dir" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) bin2data_dir=`echo "$bin2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) bin2data_dir=`echo "$bin2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) bin2data_dir=`echo "$bin2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
 cat >>confdefs.h <<_ACEOF
@@ -7176,45 +6905,27 @@ _lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
      echo "$_lcl_receval")`
   _lcl_notation="$_lcl_from$_lcl_to"
   case ":$_lcl_from:" in
-# change empty paths to '.'
   ::) _lcl_from='.' ;;
-# strip trailing slashes
   :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case '/' in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) _lcl_from=`echo "[$]_lcl_from" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   case ":$_lcl_to:" in
-# change empty paths to '.'
   ::) _lcl_to='.' ;;
-# strip trailing slashes
   :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case '/' in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) _lcl_to=`echo "[$]_lcl_to" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   _lcl_common_prefix=''
@@ -7243,47 +6954,29 @@ done
 _lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"`
 _lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix"
   case ":$_lcl_result_tmp:" in
-# change empty paths to '.'
   ::) _lcl_result_tmp='.' ;;
-# strip trailing slashes
   :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case "$_lcl_notation" in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) _lcl_result_tmp=`echo "[$]_lcl_result_tmp" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   eval $_lcl_result_var='$_lcl_result_tmp'
 done
 case ":$prefix2bin_dir:" in
-# change empty paths to '.'
   ::) prefix2bin_dir='.' ;;
-# strip trailing slashes
   :*[\\/]:) prefix2bin_dir=`echo "$prefix2bin_dir" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case $sdccconf_h_dir_separator in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) prefix2bin_dir=`echo "[$]prefix2bin_dir" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) prefix2bin_dir=`echo "$prefix2bin_dir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) prefix2bin_dir=`echo "$prefix2bin_dir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) prefix2bin_dir=`echo "$prefix2bin_dir" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
 cat >>confdefs.h <<_ACEOF
@@ -7315,45 +7008,27 @@ _lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
      echo "$_lcl_receval")`
   _lcl_notation="$_lcl_from$_lcl_to"
   case ":$_lcl_from:" in
-# change empty paths to '.'
   ::) _lcl_from='.' ;;
-# strip trailing slashes
   :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case '/' in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) _lcl_from=`echo "[$]_lcl_from" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   case ":$_lcl_to:" in
-# change empty paths to '.'
   ::) _lcl_to='.' ;;
-# strip trailing slashes
   :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case '/' in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) _lcl_to=`echo "[$]_lcl_to" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   _lcl_common_prefix=''
@@ -7382,47 +7057,29 @@ done
 _lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"`
 _lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix"
   case ":$_lcl_result_tmp:" in
-# change empty paths to '.'
   ::) _lcl_result_tmp='.' ;;
-# strip trailing slashes
   :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case "$_lcl_notation" in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) _lcl_result_tmp=`echo "[$]_lcl_result_tmp" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
   eval $_lcl_result_var='$_lcl_result_tmp'
 done
 case ":$prefix2data_dir:" in
-# change empty paths to '.'
   ::) prefix2data_dir='.' ;;
-# strip trailing slashes
   :*[\\/]:) prefix2data_dir=`echo "$prefix2data_dir" | sed 's,[\\/]*$,,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
 case $sdccconf_h_dir_separator in
-# if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) prefix2data_dir=`echo "[$]prefix2data_dir" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) prefix2data_dir=`echo "$prefix2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+    *\\*) prefix2data_dir=`echo "$prefix2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
  *) prefix2data_dir=`echo "$prefix2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
 esac
 if test "${prefix2data_dir}" = "."; then
@@ -7487,237 +7144,707 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+# Port selection helper
+# ===========================================================================
+# macro AC_DO_ENABLER()
+#   $1 used to access enable_$1, e.g. enable-doc
+#   $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. DOC
+#   $3 help string
+
+
+# macro AC_DO_DISABLER()
+#   $1 used to access disable_$1, e.g. ucsim
+#   $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. UCSIM
+#   $3 help string
+
+
+# macro AC_DO_PORT($1, $2, $3, $4)
+#   $1 used to access enable_$2_port, e.g. gbz80
+#   $2 port name in ports.all and ports.build, e.g. z80
+#   $3 OPT_DISABLE_$3, normally uppercase of $2, e.g. GBZ80
+#   $4 help string
+
+
 # Now handle the port selection
 # ===========================================================================
 rm -f ports.all ports.build
-# Check whether --enable-mcs51-port or --disable-mcs51-port was given.
+
+  # Check whether --enable-mcs51-port or --disable-mcs51-port was given.
 if test "${enable_mcs51_port+set}" = set; then
   enableval="$enable_mcs51_port"
 
 fi;
-echo mcs51 >>ports.all
-if test "$enable_mcs51_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_MCS51 1
+
+  if test "$enable_mcs51_port" = "no"; then
+    OPT_DISABLE_MCS51=1
+  else
+    enable_mcs51_port="yes"
+    OPT_DISABLE_MCS51=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_MCS51 $OPT_DISABLE_MCS51
 _ACEOF
 
-else
+
+
+  echo mcs51 >>ports.all
+  if test $OPT_DISABLE_MCS51 = 0; then
     echo mcs51 >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_MCS51 0
-_ACEOF
+  fi
 
-fi
 
-# Check whether --enable-gbz80-port or --disable-gbz80-port was given.
+  # Check whether --enable-gbz80-port or --disable-gbz80-port was given.
 if test "${enable_gbz80_port+set}" = set; then
   enableval="$enable_gbz80_port"
 
 fi;
-echo z80 >>ports.all
-if test "$enable_gbz80_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_GBZ80 1
+
+  if test "$enable_gbz80_port" = "no"; then
+    OPT_DISABLE_GBZ80=1
+  else
+    enable_gbz80_port="yes"
+    OPT_DISABLE_GBZ80=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_GBZ80 $OPT_DISABLE_GBZ80
 _ACEOF
 
-else
+
+
+  echo z80 >>ports.all
+  if test $OPT_DISABLE_GBZ80 = 0; then
     echo z80 >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_GBZ80 0
-_ACEOF
+  fi
 
-fi
 
-# Check whether --enable-z80-port or --disable-z80-port was given.
+  # Check whether --enable-z80-port or --disable-z80-port was given.
 if test "${enable_z80_port+set}" = set; then
   enableval="$enable_z80_port"
 
 fi;
-echo z80 >>ports.all
-if test "$enable_z80_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_Z80 1
+
+  if test "$enable_z80_port" = "no"; then
+    OPT_DISABLE_Z80=1
+  else
+    enable_z80_port="yes"
+    OPT_DISABLE_Z80=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_Z80 $OPT_DISABLE_Z80
 _ACEOF
 
-else
+
+
+  echo z80 >>ports.all
+  if test $OPT_DISABLE_Z80 = 0; then
     echo z80 >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_Z80 0
-_ACEOF
+  fi
 
-fi
 
-# Check whether --enable-avr-port or --disable-avr-port was given.
+  # Check whether --enable-avr-port or --disable-avr-port was given.
 if test "${enable_avr_port+set}" = set; then
   enableval="$enable_avr_port"
 
 fi;
-echo avr >>ports.all
-if test "$enable_avr_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_AVR 1
+
+  if test "$enable_avr_port" = "no"; then
+    OPT_DISABLE_AVR=1
+  else
+    enable_avr_port="yes"
+    OPT_DISABLE_AVR=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_AVR $OPT_DISABLE_AVR
 _ACEOF
 
-else
+
+
+  echo avr >>ports.all
+  if test $OPT_DISABLE_AVR = 0; then
     echo avr >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_AVR 0
-_ACEOF
+  fi
 
-fi
 
-# Check whether --enable-ds390-port or --disable-ds390-port was given.
+  # Check whether --enable-ds390-port or --disable-ds390-port was given.
 if test "${enable_ds390_port+set}" = set; then
   enableval="$enable_ds390_port"
 
 fi;
-echo ds390 >>ports.all
-if test "$enable_ds390_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_DS390 1
-_ACEOF
 
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_TININative 1
+  if test "$enable_ds390_port" = "no"; then
+    OPT_DISABLE_DS390=1
+  else
+    enable_ds390_port="yes"
+    OPT_DISABLE_DS390=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_DS390 $OPT_DISABLE_DS390
 _ACEOF
 
-else
+
+
+  echo ds390 >>ports.all
+  if test $OPT_DISABLE_DS390 = 0; then
     echo ds390 >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_DS390 0
-_ACEOF
+  fi
 
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_TININative 0
+cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_TININative $OPT_DISABLE_DS390
 _ACEOF
 
-fi
 
-# Check whether --enable-ds400-port or --disable-ds400-port was given.
+  # Check whether --enable-ds400-port or --disable-ds400-port was given.
 if test "${enable_ds400_port+set}" = set; then
   enableval="$enable_ds400_port"
 
 fi;
-echo ds400 >>ports.all
-if test "$enable_ds400_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_DS400 1
-_ACEOF
 
-else
-    echo ds400 >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_DS400 0
+  if test "$enable_ds400_port" = "no"; then
+    OPT_DISABLE_DS400=1
+  else
+    enable_ds400_port="yes"
+    OPT_DISABLE_DS400=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_DS400 $OPT_DISABLE_DS400
 _ACEOF
 
-fi
 
-# Check whether --enable-pic-port or --disable-pic-port was given.
+
+  echo ds400 >>ports.all
+  if test $OPT_DISABLE_DS400 = 0; then
+    echo ds400 >>ports.build
+  fi
+
+
+  # Check whether --enable-pic-port or --disable-pic-port was given.
 if test "${enable_pic_port+set}" = set; then
   enableval="$enable_pic_port"
 
 fi;
-echo pic >>ports.all
-if test "$enable_pic_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_PIC 1
+
+  if test "$enable_pic_port" = "no"; then
+    OPT_DISABLE_PIC=1
+  else
+    enable_pic_port="yes"
+    OPT_DISABLE_PIC=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_PIC $OPT_DISABLE_PIC
 _ACEOF
 
-else
+
+
+  echo pic >>ports.all
+  if test $OPT_DISABLE_PIC = 0; then
     echo pic >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_PIC 0
-_ACEOF
+  fi
 
-fi
 
-# Check whether --enable-pic16-port or --disable-pic16-port was given.
+  # Check whether --enable-pic16-port or --disable-pic16-port was given.
 if test "${enable_pic16_port+set}" = set; then
   enableval="$enable_pic16_port"
 
 fi;
-echo pic16 >>ports.all
-if test "$enable_pic16_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_PIC16 1
+
+  if test "$enable_pic16_port" = "no"; then
+    OPT_DISABLE_PIC16=1
+  else
+    enable_pic16_port="yes"
+    OPT_DISABLE_PIC16=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_PIC16 $OPT_DISABLE_PIC16
 _ACEOF
 
-else
+
+
+  echo pic16 >>ports.all
+  if test $OPT_DISABLE_PIC16 = 0; then
     echo pic16 >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_PIC16 0
-_ACEOF
+  fi
 
-fi
 
-# Check whether --enable-xa51-port or --disable-xa51-port was given.
+  # Check whether --enable-xa51-port or --disable-xa51-port was given.
 if test "${enable_xa51_port+set}" = set; then
   enableval="$enable_xa51_port"
 
 fi;
-echo xa51 >>ports.all
-if test "$enable_xa51_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_XA51 1
+
+  if test "$enable_xa51_port" = "no"; then
+    OPT_DISABLE_XA51=1
+  else
+    enable_xa51_port="yes"
+    OPT_DISABLE_XA51=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_XA51 $OPT_DISABLE_XA51
 _ACEOF
 
-else
+
+
+  echo xa51 >>ports.all
+  if test $OPT_DISABLE_XA51 = 0; then
     echo xa51 >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_XA51 0
-_ACEOF
+  fi
 
-fi
 
-# Check whether --enable-hc08-port or --disable-hc08-port was given.
+  # Check whether --enable-hc08-port or --disable-hc08-port was given.
 if test "${enable_hc08_port+set}" = set; then
   enableval="$enable_hc08_port"
 
 fi;
-echo hc08 >>ports.all
-if test "$enable_hc08_port" = "no"; then
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_HC08 1
+
+  if test "$enable_hc08_port" = "no"; then
+    OPT_DISABLE_HC08=1
+  else
+    enable_hc08_port="yes"
+    OPT_DISABLE_HC08=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_HC08 $OPT_DISABLE_HC08
 _ACEOF
 
-else
+
+
+  echo hc08 >>ports.all
+  if test $OPT_DISABLE_HC08 = 0; then
     echo hc08 >>ports.build
-    cat >>confdefs.h <<_ACEOF
-#define OPT_DISABLE_HC08 0
-_ACEOF
+  fi
+
 
-fi
 
-# Check whether --enable-ucsim or --disable-ucsim was given.
+  # Check whether --enable-ucsim or --disable-ucsim was given.
 if test "${enable_ucsim+set}" = set; then
   enableval="$enable_ucsim"
 
 fi;
-OPT_ENABLE_UCSIM=$enable_ucsim
+
+      arg1=`echo ucsim | sed s/-/_/`
+
+  if test "`eval echo \\$enable_$arg1`" = "no"; then
+    OPT_DISABLE_UCSIM=1
+  else
+    OPT_DISABLE_UCSIM=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_UCSIM $OPT_DISABLE_UCSIM
+_ACEOF
+
 
 
-# Check whether --enable-device-lib-build or --disable-device-lib-build was given.
-if test "${enable_device_lib_build+set}" = set; then
-  enableval="$enable_device_lib_build"
+
+  # Check whether --enable-device-lib or --disable-device-lib was given.
+if test "${enable_device_lib+set}" = set; then
+  enableval="$enable_device_lib"
 
 fi;
-OPT_ENABLE_DEVICE_LIB_BUILD=$enable_device_lib_build
 
+      arg1=`echo device-lib | sed s/-/_/`
+
+  if test "`eval echo \\$enable_$arg1`" = "no"; then
+    OPT_DISABLE_DEVICE_LIB=1
+  else
+    OPT_DISABLE_DEVICE_LIB=0
+  fi
 
-# Check whether --enable-packihx or --disable-packihx was given.
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_DEVICE_LIB $OPT_DISABLE_DEVICE_LIB
+_ACEOF
+
+
+
+
+  # Check whether --enable-packihx or --disable-packihx was given.
 if test "${enable_packihx+set}" = set; then
   enableval="$enable_packihx"
 
 fi;
-OPT_ENABLE_PACKIHX=$enable_packihx
+
+      arg1=`echo packihx | sed s/-/_/`
+
+  if test "`eval echo \\$enable_$arg1`" = "no"; then
+    OPT_DISABLE_PACKIHX=1
+  else
+    OPT_DISABLE_PACKIHX=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_PACKIHX $OPT_DISABLE_PACKIHX
+_ACEOF
+
+
 
 
-# Check whether --enable-libgc or --disable-libgc was given.
+  # Check whether --enable-sdcpp or --disable-sdcpp was given.
+if test "${enable_sdcpp+set}" = set; then
+  enableval="$enable_sdcpp"
+
+fi;
+
+      arg1=`echo sdcpp | sed s/-/_/`
+
+  if test "`eval echo \\$enable_$arg1`" = "no"; then
+    OPT_DISABLE_SDCPP=1
+  else
+    OPT_DISABLE_SDCPP=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_SDCPP $OPT_DISABLE_SDCPP
+_ACEOF
+
+
+
+
+
+  # Check whether --enable-doc or --disable-doc was given.
+if test "${enable_doc+set}" = set; then
+  enableval="$enable_doc"
+
+fi;
+
+  if test "$enable_doc" = "yes"; then
+    OPT_ENABLE_DOC=1
+  else
+    OPT_ENABLE_DOC=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_ENABLE_DOC $OPT_ENABLE_DOC
+_ACEOF
+
+
+
+if test $OPT_ENABLE_DOC = 1; then
+  # Extract the first word of "lyx", so it can be a program name with args.
+set dummy lyx; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LYX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LYX"; then
+  ac_cv_prog_LYX="$LYX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LYX="lyx"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_LYX" && ac_cv_prog_LYX=":"
+fi
+fi
+LYX=$ac_cv_prog_LYX
+if test -n "$LYX"; then
+  echo "$as_me:$LINENO: result: $LYX" >&5
+echo "${ECHO_T}$LYX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  # Extract the first word of "latex", so it can be a program name with args.
+set dummy latex; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LATEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LATEX"; then
+  ac_cv_prog_LATEX="$LATEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LATEX="latex"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_LATEX" && ac_cv_prog_LATEX=":"
+fi
+fi
+LATEX=$ac_cv_prog_LATEX
+if test -n "$LATEX"; then
+  echo "$as_me:$LINENO: result: $LATEX" >&5
+echo "${ECHO_T}$LATEX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  # Extract the first word of "latex2html", so it can be a program name with args.
+set dummy latex2html; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LATEX2HTML+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LATEX2HTML"; then
+  ac_cv_prog_LATEX2HTML="$LATEX2HTML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LATEX2HTML="latex2html"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_LATEX2HTML" && ac_cv_prog_LATEX2HTML=":"
+fi
+fi
+LATEX2HTML=$ac_cv_prog_LATEX2HTML
+if test -n "$LATEX2HTML"; then
+  echo "$as_me:$LINENO: result: $LATEX2HTML" >&5
+echo "${ECHO_T}$LATEX2HTML" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  # Extract the first word of "pdflatex", so it can be a program name with args.
+set dummy pdflatex; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_PDFLATEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PDFLATEX"; then
+  ac_cv_prog_PDFLATEX="$PDFLATEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PDFLATEX="pdflatex"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_PDFLATEX" && ac_cv_prog_PDFLATEX=":"
+fi
+fi
+PDFLATEX=$ac_cv_prog_PDFLATEX
+if test -n "$PDFLATEX"; then
+  echo "$as_me:$LINENO: result: $PDFLATEX" >&5
+echo "${ECHO_T}$PDFLATEX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  # Extract the first word of "dvipdf", so it can be a program name with args.
+set dummy dvipdf; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DVIPDF+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DVIPDF"; then
+  ac_cv_prog_DVIPDF="$DVIPDF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DVIPDF="dvipdf"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_DVIPDF" && ac_cv_prog_DVIPDF=":"
+fi
+fi
+DVIPDF=$ac_cv_prog_DVIPDF
+if test -n "$DVIPDF"; then
+  echo "$as_me:$LINENO: result: $DVIPDF" >&5
+echo "${ECHO_T}$DVIPDF" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  # Extract the first word of "dvips", so it can be a program name with args.
+set dummy dvips; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DVIPS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DVIPS"; then
+  ac_cv_prog_DVIPS="$DVIPS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DVIPS="dvips"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_DVIPS" && ac_cv_prog_DVIPS=":"
+fi
+fi
+DVIPS=$ac_cv_prog_DVIPS
+if test -n "$DVIPS"; then
+  echo "$as_me:$LINENO: result: $DVIPS" >&5
+echo "${ECHO_T}$DVIPS" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  # Extract the first word of "makeindex", so it can be a program name with args.
+set dummy makeindex; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKEINDEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MAKEINDEX"; then
+  ac_cv_prog_MAKEINDEX="$MAKEINDEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MAKEINDEX="makeindex"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_MAKEINDEX" && ac_cv_prog_MAKEINDEX=":"
+fi
+fi
+MAKEINDEX=$ac_cv_prog_MAKEINDEX
+if test -n "$MAKEINDEX"; then
+  echo "$as_me:$LINENO: result: $MAKEINDEX" >&5
+echo "${ECHO_T}$MAKEINDEX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+  if test "$LYX" = ":"; then
+  { { echo "$as_me:$LINENO: error: Cannot find required program lyx." >&5
+echo "$as_me: error: Cannot find required program lyx." >&2;}
+   { (exit 1); exit 1; }; }
+ fi
+
+  if test "$LATEX" = ":"; then
+  { { echo "$as_me:$LINENO: error: Cannot find required program latex." >&5
+echo "$as_me: error: Cannot find required program latex." >&2;}
+   { (exit 1); exit 1; }; }
+ fi
+
+  if test "$LATEX2HTML" = ":"; then
+  { { echo "$as_me:$LINENO: error: Cannot find required program latex2html." >&5
+echo "$as_me: error: Cannot find required program latex2html." >&2;}
+   { (exit 1); exit 1; }; }
+ fi
+
+  if test "$PDFLATEX" = ":"; then
+  { { echo "$as_me:$LINENO: error: Cannot find required program pdflatex." >&5
+echo "$as_me: error: Cannot find required program pdflatex." >&2;}
+   { (exit 1); exit 1; }; }
+ fi
+
+  if test "$DVIPDF" = ":"; then
+  { { echo "$as_me:$LINENO: error: Cannot find required program dvipdf." >&5
+echo "$as_me: error: Cannot find required program dvipdf." >&2;}
+   { (exit 1); exit 1; }; }
+ fi
+
+  if test "$DVIPS" = ":"; then
+  { { echo "$as_me:$LINENO: error: Cannot find required program dvips." >&5
+echo "$as_me: error: Cannot find required program dvips." >&2;}
+   { (exit 1); exit 1; }; }
+ fi
+
+  if test "$MAKEINDEX" = ":"; then
+  { { echo "$as_me:$LINENO: error: Cannot find required program makeindex." >&5
+echo "$as_me: error: Cannot find required program makeindex." >&2;}
+   { (exit 1); exit 1; }; }
+ fi
+
+fi
+
+
+  # Check whether --enable-libgc or --disable-libgc was given.
 if test "${enable_libgc+set}" = set; then
   enableval="$enable_libgc"
 
 fi;
-if test "$enable_libgc" = "yes"; then
+
+  if test "$enable_libgc" = "yes"; then
+    OPT_ENABLE_LIBGC=1
+  else
+    OPT_ENABLE_LIBGC=0
+  fi
+
+  cat >>confdefs.h <<_ACEOF
+#define OPT_ENABLE_LIBGC $OPT_ENABLE_LIBGC
+_ACEOF
+
+
+
+if test $OPT_ENABLE_LIBGC = 1; then
 
 echo "$as_me:$LINENO: checking for GC_malloc in -lgc" >&5
 echo $ECHO_N "checking for GC_malloc in -lgc... $ECHO_C" >&6
@@ -7792,14 +7919,12 @@ _ACEOF
 
 fi
 
-        OPT_ENABLE_LIBGC=1
-else
-        OPT_ENABLE_LIBGC=0
+  if test $ac_cv_lib_gc_GC_malloc = no; then
+    { { echo "$as_me:$LINENO: error: Cannot find library libgc with Bohem memory allocator." >&5
+echo "$as_me: error: Cannot find library libgc with Bohem memory allocator." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
 fi
-cat >>confdefs.h <<_ACEOF
-#define OPT_ENABLE_LIBGC $OPT_ENABLE_LIBGC
-_ACEOF
-
 
 #remove duplicates
 uniq ports.all ports
@@ -7809,28 +7934,83 @@ mv ports ports.build
 
 # Generating output files
 # ===========================================================================
-
+test $OPT_DISABLE_SDCPP   = 0 &&
 
 subdirs="$subdirs support/cpp2"
 
-
+test $OPT_DISABLE_PACKIHX = 0 &&
 
 subdirs="$subdirs packihx"
 
-
+test $OPT_DISABLE_UCSIM   = 0 &&
 
 subdirs="$subdirs sim/ucsim"
 
+test $OPT_ENABLE_DOC      = 1 &&           ac_config_files="$ac_config_files doc/Makefile"
 
 
-subdirs="$subdirs device/lib/pic16"
+test $OPT_DISABLE_AVR = 0 &&           ac_config_files="$ac_config_files src/avr/Makefile"
+
+
+if test $OPT_DISABLE_DS390 = 0; then
+            ac_config_files="$ac_config_files src/ds390/Makefile"
+
+  test $OPT_DISABLE_DEVICE_LIB = 0 &&           ac_config_files="$ac_config_files device/lib/ds390/Makefile"
+
+fi
+
+if test $OPT_DISABLE_DS400 = 0; then
+            ac_config_files="$ac_config_files src/ds400/Makefile"
+
+  test $OPT_DISABLE_DEVICE_LIB = 0 &&           ac_config_files="$ac_config_files device/lib/ds400/Makefile"
+
+fi
 
+if test $OPT_DISABLE_HC08 = 0; then
+                      ac_config_files="$ac_config_files src/hc08/Makefile as/hc08/Makefile"
 
+  test $OPT_DISABLE_DEVICE_LIB = 0 &&           ac_config_files="$ac_config_files device/lib/hc08/Makefile"
+
+fi
+
+if test $OPT_DISABLE_MCS51 = 0; then
+                                ac_config_files="$ac_config_files src/mcs51/Makefile as/mcs51/Makefile debugger/mcs51/Makefile"
+
+  test $OPT_DISABLE_DEVICE_LIB = 0 &&                                         ac_config_files="$ac_config_files device/lib/mcs51/Makefile device/lib/small/Makefile device/lib/medium/Makefile device/lib/large/Makefile"
+
+fi
+
+if test $OPT_DISABLE_PIC = 0; then
+            ac_config_files="$ac_config_files src/pic/Makefile"
+
+  test $OPT_DISABLE_DEVICE_LIB = 0 &&
 
 subdirs="$subdirs device/lib/pic"
 
+fi
+if test $OPT_DISABLE_PIC16 = 0; then
+            ac_config_files="$ac_config_files src/pic16/Makefile"
+
+  test $OPT_DISABLE_DEVICE_LIB = 0 &&
+
+subdirs="$subdirs device/lib/pic16"
+
+fi
+
+test $OPT_DISABLE_XA51 = 0 &&           ac_config_files="$ac_config_files src/xa51/Makefile"
 
-                                                                                          ac_config_files="$ac_config_files main.mk:main_in.mk src/Makefile as/mcs51/Makefile as/hc08/Makefile device/include/Makefile device/lib/Makefile debugger/mcs51/Makefile support/regression/Makefile Makefile.common:Makefile.common.in"
+
+if test $OPT_DISABLE_Z80 = 0; then
+                                                    ac_config_files="$ac_config_files src/z80/Makefile as/Makefile as/z80/Makefile link/Makefile link/z80/Makefile"
+
+  test $OPT_DISABLE_DEVICE_LIB = 0 &&                     ac_config_files="$ac_config_files device/lib/z80/Makefile device/lib/gbz80/Makefile"
+
+fi
+
+test $OPT_DISABLE_DEVICE_LIB = 0 &&           ac_config_files="$ac_config_files device/lib/Makefile"
+
+
+                                                                                          ac_config_files="$ac_config_files main.mk:main_in.mk src/Makefile device/include/Makefile support/librarian/Makefile support/makebin/Makefile support/regression/Makefile support/valdiag/Makefile Makefile Makefile.common:Makefile.common.in"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -8357,14 +8537,41 @@ for ac_config_target in $ac_config_targets
 do
   case "$ac_config_target" in
   # Handling of arguments.
+  "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+  "src/avr/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/avr/Makefile" ;;
+  "src/ds390/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/ds390/Makefile" ;;
+  "device/lib/ds390/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/ds390/Makefile" ;;
+  "src/ds400/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/ds400/Makefile" ;;
+  "device/lib/ds400/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/ds400/Makefile" ;;
+  "src/hc08/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/hc08/Makefile" ;;
+  "as/hc08/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/hc08/Makefile" ;;
+  "device/lib/hc08/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/hc08/Makefile" ;;
+  "src/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mcs51/Makefile" ;;
+  "as/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/mcs51/Makefile" ;;
+  "debugger/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES debugger/mcs51/Makefile" ;;
+  "device/lib/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/mcs51/Makefile" ;;
+  "device/lib/small/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/small/Makefile" ;;
+  "device/lib/medium/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/medium/Makefile" ;;
+  "device/lib/large/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/large/Makefile" ;;
+  "src/pic/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/pic/Makefile" ;;
+  "src/pic16/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/pic16/Makefile" ;;
+  "src/xa51/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/xa51/Makefile" ;;
+  "src/z80/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/z80/Makefile" ;;
+  "as/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/Makefile" ;;
+  "as/z80/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/z80/Makefile" ;;
+  "link/Makefile" ) CONFIG_FILES="$CONFIG_FILES link/Makefile" ;;
+  "link/z80/Makefile" ) CONFIG_FILES="$CONFIG_FILES link/z80/Makefile" ;;
+  "device/lib/z80/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/z80/Makefile" ;;
+  "device/lib/gbz80/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/gbz80/Makefile" ;;
+  "device/lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/Makefile" ;;
   "main.mk" ) CONFIG_FILES="$CONFIG_FILES main.mk:main_in.mk" ;;
   "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
-  "as/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/mcs51/Makefile" ;;
-  "as/hc08/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/hc08/Makefile" ;;
   "device/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/include/Makefile" ;;
-  "device/lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/Makefile" ;;
-  "debugger/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES debugger/mcs51/Makefile" ;;
+  "support/librarian/Makefile" ) CONFIG_FILES="$CONFIG_FILES support/librarian/Makefile" ;;
+  "support/makebin/Makefile" ) CONFIG_FILES="$CONFIG_FILES support/makebin/Makefile" ;;
   "support/regression/Makefile" ) CONFIG_FILES="$CONFIG_FILES support/regression/Makefile" ;;
+  "support/valdiag/Makefile" ) CONFIG_FILES="$CONFIG_FILES support/valdiag/Makefile" ;;
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common:Makefile.common.in" ;;
   "sdccconf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS sdccconf.h:sdccconf_in.h" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
@@ -8480,20 +8687,35 @@ s,@AUTOCONF@,$AUTOCONF,;t t
 s,@STRIP@,$STRIP,;t t
 s,@AS@,$AS,;t t
 s,@CP@,$CP,;t t
-s,@LYX@,$LYX,;t t
-s,@LATEX@,$LATEX,;t t
-s,@LATEX2HTML@,$LATEX2HTML,;t t
-s,@PDFLATEX@,$PDFLATEX,;t t
-s,@DVIPDF@,$DVIPDF,;t t
 s,@EGREP@,$EGREP,;t t
 s,@M_OR_MM@,$M_OR_MM,;t t
 s,@sdccconf_h_dir_separator@,$sdccconf_h_dir_separator,;t t
 s,@include_dir_suffix@,$include_dir_suffix,;t t
 s,@lib_dir_suffix@,$lib_dir_suffix,;t t
 s,@docdir@,$docdir,;t t
-s,@OPT_ENABLE_UCSIM@,$OPT_ENABLE_UCSIM,;t t
-s,@OPT_ENABLE_DEVICE_LIB_BUILD@,$OPT_ENABLE_DEVICE_LIB_BUILD,;t t
-s,@OPT_ENABLE_PACKIHX@,$OPT_ENABLE_PACKIHX,;t t
+s,@OPT_DISABLE_MCS51@,$OPT_DISABLE_MCS51,;t t
+s,@OPT_DISABLE_GBZ80@,$OPT_DISABLE_GBZ80,;t t
+s,@OPT_DISABLE_Z80@,$OPT_DISABLE_Z80,;t t
+s,@OPT_DISABLE_AVR@,$OPT_DISABLE_AVR,;t t
+s,@OPT_DISABLE_DS390@,$OPT_DISABLE_DS390,;t t
+s,@OPT_DISABLE_DS400@,$OPT_DISABLE_DS400,;t t
+s,@OPT_DISABLE_PIC@,$OPT_DISABLE_PIC,;t t
+s,@OPT_DISABLE_PIC16@,$OPT_DISABLE_PIC16,;t t
+s,@OPT_DISABLE_XA51@,$OPT_DISABLE_XA51,;t t
+s,@OPT_DISABLE_HC08@,$OPT_DISABLE_HC08,;t t
+s,@OPT_DISABLE_UCSIM@,$OPT_DISABLE_UCSIM,;t t
+s,@OPT_DISABLE_DEVICE_LIB@,$OPT_DISABLE_DEVICE_LIB,;t t
+s,@OPT_DISABLE_PACKIHX@,$OPT_DISABLE_PACKIHX,;t t
+s,@OPT_DISABLE_SDCPP@,$OPT_DISABLE_SDCPP,;t t
+s,@OPT_ENABLE_DOC@,$OPT_ENABLE_DOC,;t t
+s,@LYX@,$LYX,;t t
+s,@LATEX@,$LATEX,;t t
+s,@LATEX2HTML@,$LATEX2HTML,;t t
+s,@PDFLATEX@,$PDFLATEX,;t t
+s,@DVIPDF@,$DVIPDF,;t t
+s,@DVIPS@,$DVIPS,;t t
+s,@MAKEINDEX@,$MAKEINDEX,;t t
+s,@OPT_ENABLE_LIBGC@,$OPT_ENABLE_LIBGC,;t t
 s,@subdirs@,$subdirs,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
@@ -9166,4 +9388,218 @@ echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
 fi
 
 
+# I found no better place
+mkdir -p bin
+
+# Prepare result message
+# ======================
+
+# In the C-header we need \\ as dir-separator, but in the message only \
+dirch=${sdccconf_h_dir_separator}
+test ${dirch} = '\\' && dirch='\'
+
+# calc friendly strings
+
+binPath=`echo "/${prefix2bin_dir}" | sed 's,/\./,/,g'`
+case ":$binPath:" in
+  ::) binPath='.' ;;
+  :*[\\/]:) binPath=`echo "$binPath" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+case $dirch in
+
+    *\\*) binPath=`echo "$binPath" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
+
+ *) binPath=`echo "$binPath" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+binPath=`echo "$binPath" | sed 's,\\\\\\\\,\\\\,g'`
+
+
+incPath1=`echo "/${prefix2data_dir}/${norm_inc_dir_suffix}" | sed 's,/\./,/,g'`
+case ":$incPath1:" in
+  ::) incPath1='.' ;;
+  :*[\\/]:) incPath1=`echo "$incPath1" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+case $dirch in
+
+    *\\*) incPath1=`echo "$incPath1" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
+
+ *) incPath1=`echo "$incPath1" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+incPath1=`echo "$incPath1" | sed 's,\\\\\\\\,\\\\,g'`
+
+
+incPath2=`echo "/${bin2data_dir}/${norm_inc_dir_suffix}" | sed 's,/\./,/,g'`
+case ":$incPath2:" in
+  ::) incPath2='.' ;;
+  :*[\\/]:) incPath2=`echo "$incPath2" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+case $dirch in
+
+    *\\*) incPath2=`echo "$incPath2" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
+
+ *) incPath2=`echo "$incPath2" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+incPath2=`echo "$incPath2" | sed 's,\\\\\\\\,\\\\,g'`
+
+
+incPath3=`echo "${expanded_datadir}/${norm_inc_dir_suffix}" | sed 's,/\./,/,g'`
+case ":$incPath3:" in
+  ::) incPath3='.' ;;
+  :*[\\/]:) incPath3=`echo "$incPath3" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+case $dirch in
+
+    *\\*) incPath3=`echo "$incPath3" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
+
+ *) incPath3=`echo "$incPath3" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+incPath3=`echo "$incPath3" | sed 's,\\\\\\\\,\\\\,g'`
+
+
+libPath1=`echo "/${prefix2data_dir}/${norm_lib_dir_suffix}" | sed 's,/\./,/,g'`
+case ":$libPath1:" in
+  ::) libPath1='.' ;;
+  :*[\\/]:) libPath1=`echo "$libPath1" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+case $dirch in
+
+    *\\*) libPath1=`echo "$libPath1" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
+
+ *) libPath1=`echo "$libPath1" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+libPath1=`echo "$libPath1" | sed 's,\\\\\\\\,\\\\,g'`
+
+
+libPath2=`echo "/${bin2data_dir}/${norm_lib_dir_suffix}" | sed 's,/\./,/,g'`
+case ":$libPath2:" in
+  ::) libPath2='.' ;;
+  :*[\\/]:) libPath2=`echo "$libPath2" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+case $dirch in
+
+    *\\*) libPath2=`echo "$libPath2" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
+
+ *) libPath2=`echo "$libPath2" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+libPath2=`echo "$libPath2" | sed 's,\\\\\\\\,\\\\,g'`
+
+
+libPath3=`echo "${expanded_datadir}/${norm_lib_dir_suffix}" | sed 's,/\./,/,g'`
+case ":$libPath3:" in
+  ::) libPath3='.' ;;
+  :*[\\/]:) libPath3=`echo "$libPath3" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+case $dirch in
+
+    *\\*) libPath3=`echo "$libPath3" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g
+                                  s,^[\\/],\\\\\\\\,'` ;;
+
+ *) libPath3=`echo "$libPath3" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+libPath3=`echo "$libPath3" | sed 's,\\\\\\\\,\\\\,g'`
+
+
+echo "$as_me:$LINENO: result:
+sdcc ${VERSION} is now configured for
+
+  Build:                ${build_alias}
+  Host:                 ${host_alias}
+  Source directory:     ${srcdir}
+  C compiler:           ${CC}
+  CFLAGS:               ${CFLAGS}
+
+  ENABLED Ports:
+    avr                 ${enable_avr_port}
+    ds390               ${enable_ds390_port}
+    ds400               ${enable_ds400_port}
+    gbz80               ${enable_gbz80_port}
+    hc08                ${enable_hc08_port}
+    pic                 ${enable_pic_port}
+    pic16               ${enable_pic16_port}
+    xa51                ${enable_xa51_port}
+    z80                 ${enable_z80_port}
+
+  Disable packihx:      ${OPT_DISABLE_PACKIHX}
+  Disable ucsim:        ${OPT_DISABLE_UCSIM}
+  Disable device lib:   ${OPT_DISABLE_DEVICE_LIB}
+  Disable ucsim:        ${OPT_DISABLE_UCSIM}
+  Enable documentation: ${OPT_ENABLE_DOC}
+  Enable libgc:         ${OPT_ENABLE_LIBGC}
+
+  Install paths:
+    binary files:       ${exec_prefix}
+    include files:      ${datadir}/${include_dir_suffix}
+    library files:      ${datadir}/${lib_dir_suffix}
+    documentation:      ${docdir}
+
+    prefix:             ${prefix}
+    datadir:            ${datadir}
+
+  Search paths (incomplete, see manual for all search paths):
+    binary files:       \$SDCC_HOME${binPath}
+    include files:      ${incPath1}
+                        path(argv[0])${incPath2}
+                        ${incPath3}
+    library files:      \$SDCC_HOME${libPath1}${dirch}<model>
+                        path(argv[0])${libPath2}${dirch}<model>
+                        ${libPath3}${dirch}<model>
+" >&5
+echo "${ECHO_T}
+sdcc ${VERSION} is now configured for
+
+  Build:                ${build_alias}
+  Host:                 ${host_alias}
+  Source directory:     ${srcdir}
+  C compiler:           ${CC}
+  CFLAGS:               ${CFLAGS}
+
+  ENABLED Ports:
+    avr                 ${enable_avr_port}
+    ds390               ${enable_ds390_port}
+    ds400               ${enable_ds400_port}
+    gbz80               ${enable_gbz80_port}
+    hc08                ${enable_hc08_port}
+    pic                 ${enable_pic_port}
+    pic16               ${enable_pic16_port}
+    xa51                ${enable_xa51_port}
+    z80                 ${enable_z80_port}
+
+  Disable packihx:      ${OPT_DISABLE_PACKIHX}
+  Disable ucsim:        ${OPT_DISABLE_UCSIM}
+  Disable device lib:   ${OPT_DISABLE_DEVICE_LIB}
+  Disable ucsim:        ${OPT_DISABLE_UCSIM}
+  Enable documentation: ${OPT_ENABLE_DOC}
+  Enable libgc:         ${OPT_ENABLE_LIBGC}
+
+  Install paths:
+    binary files:       ${exec_prefix}
+    include files:      ${datadir}/${include_dir_suffix}
+    library files:      ${datadir}/${lib_dir_suffix}
+    documentation:      ${docdir}
+
+    prefix:             ${prefix}
+    datadir:            ${datadir}
+
+  Search paths (incomplete, see manual for all search paths):
+    binary files:       \$SDCC_HOME${binPath}
+    include files:      ${incPath1}
+                        path(argv[0])${incPath2}
+                        ${incPath3}
+    library files:      \$SDCC_HOME${libPath1}${dirch}<model>
+                        path(argv[0])${libPath2}${dirch}<model>
+                        ${libPath3}${dirch}<model>
+" >&6
 # End of configure/configure.in
index fdea578bef3ba63b9d6764a48f5139e8ee12e831..eeb265dce3b831488ebe077829960a635a9f6442 100755 (executable)
@@ -2,14 +2,14 @@
 
 AC_PREREQ(2.54)
 AC_INIT
-AC_CONFIG_SRCDIR([Makefile])
+AC_CONFIG_SRCDIR([Makefile.in])
 AC_CONFIG_HEADER(sdccconf.h:sdccconf_in.h)
 
 AC_PROG_AWK
 
 AC_MSG_CHECKING(version of the package)
-if test -f .version; then
-  VERSION=`cat .version`
+if test -f ${srcdir}/.version; then
+  VERSION=`cat ${srcdir}/.version`
 elif test -f ../.version; then
   VERSION=`cat ../.version`
 else
@@ -49,12 +49,6 @@ AC_CHECK_PROG(STRIP, strip, strip, :)
 AC_CHECK_PROG(AS, as, as, :)
 AC_CHECK_PROG(CP, cp, cp, :)
 
-AC_CHECK_PROG(LYX,        lyx,        lyx, :)
-AC_CHECK_PROG(LATEX,      latex,      latex, :)
-AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html, :)
-AC_CHECK_PROG(PDFLATEX,   pdflatex,   pdflatex, :)
-AC_CHECK_PROG(DVIPDF,     dvipdf,     dvipdf, :)
-
 AC_DEFUN(SDCC_REQUIRE_PROG,
 [if test "$1" = ":"; then
   AC_MSG_ERROR([Cannot find required program $2.])
@@ -87,11 +81,11 @@ AC_CHECK_FUNCS(vsnprintf snprintf vsprintf mkstemp)
 # Macro definitions
 # ===========================================================================
 
-# DD_COPT macro checks if the compiler specified as the 1st parameter
+# adl_DD_COPT macro checks if the compiler specified as the 1st parameter
 # supports option specified as the 2nd parameter
 # For example: DD_CPORT(CXX, fPIC)
 
-AC_DEFUN(DD_COPT, [
+AC_DEFUN(adl_DD_COPT, [
 AC_CACHE_CHECK(whether $$1 accepts -$2,sdcc_cv_$1$2,
 cat >_test_.c <<EOF
 #include <stdio.h>
@@ -113,9 +107,9 @@ rm -f _test_.* a.out)
 #
 # Examples:
 #
-#  AC_EXPAND(prefix, "/usr/local", expanded_prefix)
+#  adl_EXPAND(prefix, "/usr/local", expanded_prefix)
 
-AC_DEFUN([AC_EXPAND], [
+AC_DEFUN([adl_EXPAND], [
   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
   ac_expand=[$]$1
@@ -145,24 +139,25 @@ dnl http://www.gnu.org/software/ac-archive/htmldoc/normpath.html
 dnl
 AC_DEFUN([adl_NORMALIZE_PATH],
 [case ":[$]$1:" in
-# change empty paths to '.'
+dnl change empty paths to '.'
   ::) $1='.' ;;
-# strip trailing slashes
+dnl strip trailing slashes
   :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;;
   :*:) ;;
 esac
-# squeze repeated slashes
+dnl squeze repeated slashes
 case ifelse($2,,"[$]$1",$2) in
-# if the path contains any backslashes, turn slashes into backslashes
+dnl if the path contains any backslashes, turn slashes into backslashes
 
-# Bernhard Held 2003-04-06
-# This was the original line. It doesn't:
-# - convert the first slash
-# - replace a slash with a double-backslash
-# *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
- *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\\\\\,g' | sed 's,^[[\\/]],\\\\\\\\,'` ;;
+dnl Bernhard Held 2003-04-06
+dnl This was the original line. It does not:
+dnl - convert the first slash
+dnl - replace a slash with a double-backslash
+dnl *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+    *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\\\\\,g
+                                  s,^[[\\/]],\\\\\\\\,'` ;;
 
-# if the path contains slashes, also turn backslashes into slashes
+dnl if the path contains slashes, also turn backslashes into slashes
  *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;;
 esac])
 
@@ -281,9 +276,9 @@ done])
 
 dnl adl_RECURSIVE_EVAL(VALUE, RESULT)
 dnl =================================
-dnl Interpolate the VALUE in loop until it doesn't change,
+dnl Interpolate the VALUE in loop until it does not change,
 dnl and set the result to $RESULT.
-dnl WARNING: It's easy to get an infinite loop with some unsane input.
+dnl WARNING: It is easy to get an infinite loop with some unsane input.
 AC_DEFUN([adl_RECURSIVE_EVAL],
 [_lcl_receval="$1"
 $2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
@@ -295,15 +290,24 @@ $2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
      done
      echo "[$]_lcl_receval")`])
 
-
-# AC_NORMALIZE_DEFINE_UNQUOTED(var, DEFINE, REFERENCE_STRING)
-
-AC_DEFUN([AC_NORMALIZE_DEFINE_UNQUOTED], [
+dnl adl_NORMALIZE_DEFINE_UNQUOTED(var, DEFINE, REFERENCE_STRING)
+AC_DEFUN([adl_NORMALIZE_DEFINE_UNQUOTED], [
   ac_ndu=[$]$1
   adl_NORMALIZE_PATH([ac_ndu], [$]$3)
   AC_DEFINE_UNQUOTED($2, "${ac_ndu}")
 ])
 
+dnl adl_NORMALIZE_PATH_MSG(input_string, var, dir_separator)
+dnl ========================================================
+dnl call adl_NORMALIZE_PATH and format it for the result message
+AC_DEFUN([adl_NORMALIZE_PATH_MSG], [
+dnl replace /./ by /
+$2=`echo "$1" | sed 's,/\./,/,g'`
+adl_NORMALIZE_PATH([$2], [$3])
+dnl replace \\ by \
+$2=`echo "[$]$2" | sed 's,\\\\\\\\,\\\\,g'`
+])
+
 
 # Checking characteristics of compilers and other programs
 # ===========================================================================
@@ -321,12 +325,12 @@ M_OR_MM=$sdcc_cv_MM
 AC_SUBST(M_OR_MM)
 
 # This is the first time when CFLAGS are set/modified!!
-DD_COPT(CC, ggdb)
+adl_DD_COPT(CC, ggdb)
 if test "$sdcc_cv_CCggdb" = "yes"; then
   CFLAGS="-ggdb ${CFLAGS}"
 fi
 
-DD_COPT(CC, pipe)
+adl_DD_COPT(CC, pipe)
 if test "$sdcc_cv_CCpipe" = "yes"; then
   CFLAGS="-pipe $CFLAGS"
 fi
@@ -391,7 +395,7 @@ AC_C_BIGENDIAN
 # The variables in the header are replaced by AC_*DEFINE*()
 # sdccconf_h_dir_separator contains a backslash.
 AC_ARG_VAR(sdccconf_h_dir_separator, needed in sdccconf.h: either "/" (default) or "\\")
-if test "${sdccconf_h_dir_separator}" = ""; then
+if test "x${sdccconf_h_dir_separator}" = "x"; then
     sdccconf_h_dir_separator="/"
 fi
 
@@ -433,23 +437,23 @@ AC_DEFINE_UNQUOTED(DIR_SEPARATOR_CHAR  , '${sdccconf_h_dir_separator}')
 
 # prefix:
 # default: "NONE", ${ac_default_prefix}: "/usr/local"
-AC_EXPAND(prefix, ac_default_prefix, expanded_prefix)
-AC_NORMALIZE_DEFINE_UNQUOTED(expanded_prefix, PREFIX, sdccconf_h_dir_separator)
+adl_EXPAND(prefix, ac_default_prefix, expanded_prefix)
+adl_NORMALIZE_DEFINE_UNQUOTED(expanded_prefix, PREFIX, sdccconf_h_dir_separator)
 
 # exec_prefix:
 # default: "${prefix}"
-AC_EXPAND(exec_prefix, expanded_prefix, expanded_exec_prefix)
-AC_NORMALIZE_DEFINE_UNQUOTED(expanded_exec_prefix, EXEC_PREFIX, sdccconf_h_dir_separator)
+adl_EXPAND(exec_prefix, expanded_prefix, expanded_exec_prefix)
+adl_NORMALIZE_DEFINE_UNQUOTED(expanded_exec_prefix, EXEC_PREFIX, sdccconf_h_dir_separator)
 
 # bindir:
 # default: "${exec_prefix}/bin"
-AC_EXPAND(bindir, "NONE", expanded_bindir)
-AC_NORMALIZE_DEFINE_UNQUOTED(expanded_bindir, BINDIR, sdccconf_h_dir_separator)
+adl_EXPAND(bindir, "NONE", expanded_bindir)
+adl_NORMALIZE_DEFINE_UNQUOTED(expanded_bindir, BINDIR, sdccconf_h_dir_separator)
 
 # datadir:
 # default: "${prefix}/share"
-AC_EXPAND(datadir, "NONE", expanded_datadir)
-AC_NORMALIZE_DEFINE_UNQUOTED(expanded_datadir, DATADIR, sdccconf_h_dir_separator)
+adl_EXPAND(datadir, "NONE", expanded_datadir)
+adl_NORMALIZE_DEFINE_UNQUOTED(expanded_datadir, DATADIR, sdccconf_h_dir_separator)
 
 # include/lib suffix
 norm_inc_dir_suffix=${include_dir_suffix}
@@ -501,174 +505,256 @@ AC_DEFINE_UNQUOTED(SDCC_INCLUDE_NAME, "${sdcc_include_name}")
 sdcc_lib_name="SDCC_LIB"
 AC_DEFINE_UNQUOTED(SDCC_LIB_NAME, "${sdcc_lib_name}")
 
+# Port selection helper
+# ===========================================================================
+# macro AC_DO_ENABLER()
+#   $1 used to access enable_$1, e.g. enable-doc
+#   $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. DOC
+#   $3 help string
+AC_DEFUN([AC_DO_ENABLER], [
+  AC_ARG_ENABLE($1, AC_HELP_STRING([--enable-$1], $3))
+
+  if test "[$]enable_$1" = "yes"; then
+    OPT_ENABLE_$2=1
+  else
+    OPT_ENABLE_$2=0
+  fi
+
+  AC_DEFINE_UNQUOTED(OPT_ENABLE_$2, [$]OPT_ENABLE_$2)
+  AC_SUBST(OPT_ENABLE_$2)
+])
+
+# macro AC_DO_DISABLER()
+#   $1 used to access disable_$1, e.g. ucsim
+#   $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. UCSIM
+#   $3 help string
+AC_DEFUN([AC_DO_DISABLER], [
+  AC_ARG_ENABLE($1, AC_HELP_STRING([--disable-$1], $3))
+
+  dnl the '-' in 'device-lib' needs special handling,
+  dnl because the variable is 'enable_device_lib'
+  arg1=`echo $1 | sed s/-/_/`
+
+  if test "`eval echo \\$enable_$arg1`" = "no"; then
+    OPT_DISABLE_$2=1
+  else
+    OPT_DISABLE_$2=0
+  fi
+
+  AC_DEFINE_UNQUOTED(OPT_DISABLE_$2, [$]OPT_DISABLE_$2)
+  AC_SUBST(OPT_DISABLE_$2)
+])
+
+# macro AC_DO_PORT($1, $2, $3, $4)
+#   $1 used to access enable_$2_port, e.g. gbz80
+#   $2 port name in ports.all and ports.build, e.g. z80
+#   $3 OPT_DISABLE_$3, normally uppercase of $2, e.g. GBZ80
+#   $4 help string
+AC_DEFUN([AC_DO_PORT], [
+  AC_ARG_ENABLE($1-port,
+                AC_HELP_STRING([--disable-$1-port], $4))
+
+  if test "[$]enable_$1_port" = "no"; then
+    OPT_DISABLE_$3=1
+  else
+    enable_$1_port="yes"
+    OPT_DISABLE_$3=0
+  fi
+
+  AC_DEFINE_UNQUOTED(OPT_DISABLE_$3, [$]OPT_DISABLE_$3)
+  AC_SUBST(OPT_DISABLE_$3)
+
+  echo $2 >>ports.all
+  if test [$]OPT_DISABLE_$3 = 0; then
+    echo $2 >>ports.build
+  fi
+])
+
 # Now handle the port selection
 # ===========================================================================
 rm -f ports.all ports.build
-AC_ARG_ENABLE(mcs51-port,
-            AC_HELP_STRING([--disable-mcs51-port],
-                           [Excludes the Intel mcs51 port]))
-echo mcs51 >>ports.all
-if test "$enable_mcs51_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_MCS51, 1)
-else
-    echo mcs51 >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_MCS51, 0)
+AC_DO_PORT(mcs51, mcs51, MCS51, [Excludes the Intel mcs51 port])
+AC_DO_PORT(gbz80, z80,   GBZ80, [Excludes the Gameboy gbz80 port])
+AC_DO_PORT(z80,   z80,   Z80,   [Excludes the z80 port])
+AC_DO_PORT(avr,   avr,   AVR,   [Excludes the AVR port])
+AC_DO_PORT(ds390, ds390, DS390, [Excludes the DS390 port])
+AC_DEFINE_UNQUOTED(OPT_DISABLE_TININative, $OPT_DISABLE_DS390)
+AC_DO_PORT(ds400, ds400, DS400, [Excludes the DS400 port])
+AC_DO_PORT(pic,   pic,   PIC,   [Excludes the PIC port])
+AC_DO_PORT(pic16, pic16, PIC16, [Excludes the PIC16 port])
+AC_DO_PORT(xa51,  xa51,  XA51,  [Excludes the XA51 port])
+AC_DO_PORT(hc08,  hc08,  HC08,  [Excludes the HC08 port])
+
+AC_DO_DISABLER(ucsim,      UCSIM,      [Disables configuring and building of ucsim])
+AC_DO_DISABLER([device-lib], DEVICE_LIB, [Disables building device libraries])
+AC_DO_DISABLER(packihx,    PACKIHX,    [Disables building packihx])
+AC_DO_DISABLER(sdcpp,      SDCPP,      [Disables building sdcpp])
+
+AC_DO_ENABLER(doc,   DOC,   [Enables building the documentation])
+if test $OPT_ENABLE_DOC = 1; then
+  AC_CHECK_PROG(LYX,        lyx,        lyx, :)
+  AC_CHECK_PROG(LATEX,      latex,      latex, :)
+  AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html, :)
+  AC_CHECK_PROG(PDFLATEX,   pdflatex,   pdflatex, :)
+  AC_CHECK_PROG(DVIPDF,     dvipdf,     dvipdf, :)
+  AC_CHECK_PROG(DVIPS,      dvips,      dvips, :)
+  AC_CHECK_PROG(MAKEINDEX,  makeindex,  makeindex, :)
+
+  SDCC_REQUIRE_PROG($LYX,        lyx)
+  SDCC_REQUIRE_PROG($LATEX,      latex)
+  SDCC_REQUIRE_PROG($LATEX2HTML, latex2html)
+  SDCC_REQUIRE_PROG($PDFLATEX,   pdflatex)
+  SDCC_REQUIRE_PROG($DVIPDF,     dvipdf)
+  SDCC_REQUIRE_PROG($DVIPS,      dvips)
+  SDCC_REQUIRE_PROG($MAKEINDEX,  makeindex)
 fi
 
-AC_ARG_ENABLE(gbz80-port,
-            AC_HELP_STRING([--disable-gbz80-port],
-                           [Excludes the Gameboy gbz80 port]))
-echo z80 >>ports.all
-if test "$enable_gbz80_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_GBZ80, 1)
-else
-    echo z80 >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_GBZ80, 0)
+AC_DO_ENABLER(libgc, LIBGC, [Use the Bohem memory allocator. Lower runtime footprint.])
+if test $OPT_ENABLE_LIBGC = 1; then
+  AC_CHECK_LIB(gc, GC_malloc)
+  if test $ac_cv_lib_gc_GC_malloc = no; then
+    AC_MSG_ERROR([Cannot find library libgc with Bohem memory allocator.])
+  fi
 fi
 
-AC_ARG_ENABLE(z80-port,
-            AC_HELP_STRING([--disable-z80-port],
-                           [Excludes the z80 port]))
-echo z80 >>ports.all
-if test "$enable_z80_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_Z80, 1)
-else
-    echo z80 >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_Z80, 0)
-fi
+#remove duplicates
+uniq ports.all ports
+mv ports ports.all
+uniq ports.build ports
+mv ports ports.build
 
-AC_ARG_ENABLE(avr-port,
-            AC_HELP_STRING([--disable-avr-port],
-                           [Excludes the AVR port]))
-echo avr >>ports.all
-if test "$enable_avr_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_AVR, 1)
-else
-    echo avr >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_AVR, 0)
-fi
+# Generating output files
+# ===========================================================================
+test $OPT_DISABLE_SDCPP   = 0 && AC_CONFIG_SUBDIRS(support/cpp2)
+test $OPT_DISABLE_PACKIHX = 0 && AC_CONFIG_SUBDIRS(packihx)
+test $OPT_DISABLE_UCSIM   = 0 && AC_CONFIG_SUBDIRS(sim/ucsim)
+test $OPT_ENABLE_DOC      = 1 && AC_CONFIG_FILES([doc/Makefile])
 
-AC_ARG_ENABLE(ds390-port,
-            AC_HELP_STRING([--disable-ds390-port],
-                           [Excludes the DS390 port]))
-echo ds390 >>ports.all
-if test "$enable_ds390_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_DS390, 1)
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_TININative, 1)
-else
-    echo ds390 >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_DS390, 0)
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_TININative, 0)
-fi
+test $OPT_DISABLE_AVR = 0 && AC_CONFIG_FILES([src/avr/Makefile])
 
-AC_ARG_ENABLE(ds400-port,
-            AC_HELP_STRING([--disable-ds400-port],
-                           [Excludes the DS400 port]))
-echo ds400 >>ports.all
-if test "$enable_ds400_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_DS400, 1)
-else
-    echo ds400 >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_DS400, 0)
+if test $OPT_DISABLE_DS390 = 0; then
+  AC_CONFIG_FILES([src/ds390/Makefile])
+  test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/ds390/Makefile])
 fi
 
-AC_ARG_ENABLE(pic-port,
-            AC_HELP_STRING([--disable-pic-port],
-                           [Excludes the PIC port]))
-echo pic >>ports.all
-if test "$enable_pic_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_PIC, 1)
-else
-    echo pic >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_PIC, 0)
+if test $OPT_DISABLE_DS400 = 0; then
+  AC_CONFIG_FILES([src/ds400/Makefile])
+  test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/ds400/Makefile])
 fi
 
-AC_ARG_ENABLE(pic16-port,
-            AC_HELP_STRING([--disable-pic16-port],
-                           [Excludes the PIC port]))
-echo pic16 >>ports.all
-if test "$enable_pic16_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_PIC16, 1)
-else
-    echo pic16 >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_PIC16, 0)
+if test $OPT_DISABLE_HC08 = 0; then
+  AC_CONFIG_FILES([src/hc08/Makefile
+                   as/hc08/Makefile])
+  test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/hc08/Makefile])
 fi
 
-AC_ARG_ENABLE(xa51-port,
-            AC_HELP_STRING([--disable-xa51-port],
-                           [Excludes the XA51 port]))
-echo xa51 >>ports.all
-if test "$enable_xa51_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_XA51, 1)
-else
-    echo xa51 >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_XA51, 0)
+if test $OPT_DISABLE_MCS51 = 0; then
+  AC_CONFIG_FILES([src/mcs51/Makefile
+                   as/mcs51/Makefile
+                   debugger/mcs51/Makefile])
+  test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/mcs51/Makefile
+                                                       device/lib/small/Makefile
+                                                       device/lib/medium/Makefile
+                                                       device/lib/large/Makefile])
 fi
 
-AC_ARG_ENABLE(hc08-port,
-            AC_HELP_STRING([--disable-hc08-port],
-                           [Excludes the HC08 port]))
-echo hc08 >>ports.all
-if test "$enable_hc08_port" = "no"; then
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_HC08, 1)
-else
-    echo hc08 >>ports.build
-    AC_DEFINE_UNQUOTED(OPT_DISABLE_HC08, 0)
+if test $OPT_DISABLE_PIC = 0; then
+  AC_CONFIG_FILES(src/pic/Makefile)
+  test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_SUBDIRS(device/lib/pic)
 fi
-
-AC_ARG_ENABLE(ucsim,
-              AC_HELP_STRING([--disable-ucsim],
-                             [Disables configuring and building of ucsim]))
-OPT_ENABLE_UCSIM=$enable_ucsim
-AC_SUBST(OPT_ENABLE_UCSIM)
-
-AC_ARG_ENABLE(device-lib-build,
-              AC_HELP_STRING([--disable-device-lib-build],
-                             [Disables automatically building device libraries]))
-OPT_ENABLE_DEVICE_LIB_BUILD=$enable_device_lib_build
-AC_SUBST(OPT_ENABLE_DEVICE_LIB_BUILD)
-
-AC_ARG_ENABLE(packihx,
-              AC_HELP_STRING([--disable-packihx],
-                             [Disables building packihx]))
-OPT_ENABLE_PACKIHX=$enable_packihx
-AC_SUBST(OPT_ENABLE_PACKIHX)
-
-AC_ARG_ENABLE(libgc,
-              AC_HELP_STRING([--enable-libgc],
-                             [Use the Bohem memory allocator. Lower runtime footprint.]))
-if test "$enable_libgc" = "yes"; then
-        AC_CHECK_LIB(gc, GC_malloc)
-        OPT_ENABLE_LIBGC=1
-else
-        OPT_ENABLE_LIBGC=0
+if test $OPT_DISABLE_PIC16 = 0; then
+  AC_CONFIG_FILES(src/pic16/Makefile)
+  test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_SUBDIRS(device/lib/pic16)
 fi
-AC_DEFINE_UNQUOTED(OPT_ENABLE_LIBGC, $OPT_ENABLE_LIBGC)
 
-#remove duplicates
-uniq ports.all ports
-mv ports ports.all
-uniq ports.build ports
-mv ports ports.build
+test $OPT_DISABLE_XA51 = 0 && AC_CONFIG_FILES([src/xa51/Makefile])
 
-# Generating output files
-# ===========================================================================
-AC_CONFIG_SUBDIRS(support/cpp2)
-AC_CONFIG_SUBDIRS(packihx)
-AC_CONFIG_SUBDIRS(sim/ucsim)
-AC_CONFIG_SUBDIRS(device/lib/pic16)
-AC_CONFIG_SUBDIRS(device/lib/pic)
+if test $OPT_DISABLE_Z80 = 0; then
+  AC_CONFIG_FILES([src/z80/Makefile
+                   as/Makefile
+                   as/z80/Makefile
+                   link/Makefile
+                   link/z80/Makefile])
+  test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/z80/Makefile
+                                                       device/lib/gbz80/Makefile])
+fi
+
+test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/Makefile])
 
 AC_CONFIG_FILES([main.mk:main_in.mk
 src/Makefile
-as/mcs51/Makefile
-as/hc08/Makefile
 device/include/Makefile
-device/lib/Makefile
-debugger/mcs51/Makefile
+support/librarian/Makefile
+support/makebin/Makefile
 support/regression/Makefile
+support/valdiag/Makefile
+Makefile
 Makefile.common:Makefile.common.in
 ])
 AC_OUTPUT
 
+# I found no better place
+mkdir -p bin
+
+# Prepare result message
+# ======================
+
+# In the C-header we need \\ as dir-separator, but in the message only \
+dirch=${sdccconf_h_dir_separator}
+test ${dirch} = '\\' && dirch='\'
+
+# calc friendly strings
+adl_NORMALIZE_PATH_MSG(/${prefix2bin_dir},                         [binPath],  [$dirch])
+adl_NORMALIZE_PATH_MSG(/${prefix2data_dir}/${norm_inc_dir_suffix}, [incPath1], [$dirch])
+adl_NORMALIZE_PATH_MSG(/${bin2data_dir}/${norm_inc_dir_suffix},    [incPath2], [$dirch])
+adl_NORMALIZE_PATH_MSG(${expanded_datadir}/${norm_inc_dir_suffix}, [incPath3], [$dirch])
+adl_NORMALIZE_PATH_MSG(/${prefix2data_dir}/${norm_lib_dir_suffix}, [libPath1], [$dirch])
+adl_NORMALIZE_PATH_MSG(/${bin2data_dir}/${norm_lib_dir_suffix},    [libPath2], [$dirch])
+adl_NORMALIZE_PATH_MSG(${expanded_datadir}/${norm_lib_dir_suffix}, [libPath3], [$dirch])
+
+AC_MSG_RESULT([
+sdcc ${VERSION} is now configured for
+
+  Build:                ${build_alias}
+  Host:                 ${host_alias}
+  Source directory:     ${srcdir}
+  C compiler:           ${CC}
+  CFLAGS:               ${CFLAGS}
+
+  ENABLED Ports:
+    avr                 ${enable_avr_port}
+    ds390               ${enable_ds390_port}
+    ds400               ${enable_ds400_port}
+    gbz80               ${enable_gbz80_port}
+    hc08                ${enable_hc08_port}
+    pic                 ${enable_pic_port}
+    pic16               ${enable_pic16_port}
+    xa51                ${enable_xa51_port}
+    z80                 ${enable_z80_port}
+
+  Disable packihx:      ${OPT_DISABLE_PACKIHX}
+  Disable ucsim:        ${OPT_DISABLE_UCSIM}
+  Disable device lib:   ${OPT_DISABLE_DEVICE_LIB}
+  Disable ucsim:        ${OPT_DISABLE_UCSIM}
+  Enable documentation: ${OPT_ENABLE_DOC}
+  Enable libgc:         ${OPT_ENABLE_LIBGC}
+
+  Install paths:
+    binary files:       ${exec_prefix}
+    include files:      ${datadir}/${include_dir_suffix}
+    library files:      ${datadir}/${lib_dir_suffix}
+    documentation:      ${docdir}
+
+    prefix:             ${prefix}
+    datadir:            ${datadir}
+
+  Search paths (incomplete, see manual for all search paths):
+    binary files:       \$SDCC_HOME${binPath}
+    include files:      ${incPath1}
+                        path(argv[[0]])${incPath2}
+                        ${incPath3}
+    library files:      \$SDCC_HOME${libPath1}${dirch}<model>
+                        path(argv[[0]])${libPath2}${dirch}<model>
+                        ${libPath3}${dirch}<model>
+])
 # End of configure/configure.in
index 9a6c9fc031b3967699632c9c94cac720469a1973..7a2af2f3289160b3edb5370b017c4f6309f46fe3 100644 (file)
@@ -13,10 +13,15 @@ CPP         = @CPP@
 INSTALL                = @INSTALL@
 STRIP           = @STRIP@
 
-PRJDIR         = ../..
-SLIB           = $(PRJDIR)/support/Util
 
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
+SLIB           = $(top_builddir)support/Util
+SDCCLIB                = $(top_builddir)src
+
+VPATH           = @srcdir@
 srcdir         = @srcdir@
+
 prefix         = @prefix@
 exec_prefix     = @exec_prefix@
 bindir          = @bindir@
@@ -29,7 +34,7 @@ man2dir         = $(mandir)/man2
 infodir         = @infodir@
 
 STD_INC                = @sdcc_include_dir@
-CPPFLAGS       = @CPPFLAGS@ -I. -I$(PRJDIR) -I$(PRJDIR)/support -I$(SLIB)
+CPPFLAGS       = @CPPFLAGS@ -I$(top_builddir) -I$(top_srcdir) -I$(srcdir)/$(SLIB)
 CFLAGS         = @CFLAGS@
 M_OR_MM                = @M_OR_MM@
 LDFLAGS                = @LDFLAGS@
@@ -39,14 +44,16 @@ EXEEXT          = @EXEEXT@
 LIBS            = @LIBS@
 LIBDIRS         =
 
-SLIBOBJS               = NewAlloc.o
+OBJECTS                = sdcdb.o symtab.o simi.o \
+                 break.o cmd.o
+SLIBOBJS       = NewAlloc.o SDCCerr.o
+SDCCOBJS       = SDCCset.o SDCChasht.o
 
-OBJECTS                = sdcdb.o symtab.o simi.o $(PRJDIR)/src/SDCCset.o \
-                 break.o cmd.o $(PRJDIR)/src/SDCChasht.o \
-                 $(PRJDIR)/support/Util/SDCCerr.o
 SOURCES                = $(patsubst %.o,%.c,$(OBJECTS))
+SLIBSOURCES    = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS))
+SDCCSOURCES    = $(patsubst %.o,$(SDCCLIB)/%.c,$(SDCCOBJS))
 
-TARGET         = $(PRJDIR)/bin/sdcdb$(EXEEXT)
+TARGET         = $(top_builddir)bin/sdcdb$(EXEEXT)
 
 
 # Compiling entire program or any subproject
@@ -58,8 +65,8 @@ all: checkconf $(TARGET)
 install: all installdirs
        $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
        $(STRIP) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
-       cp $(PRJDIR)/debugger/mcs51/sdcdb.el $(DESTDIR)$(bindir)/sdcdb.el
-       cp $(PRJDIR)/debugger/mcs51/sdcdbsrc.el $(DESTDIR)$(bindir)/sdcdbsrc.el
+       cp $(srcdir)/sdcdb.el $(DESTDIR)$(bindir)/sdcdb.el
+       cp $(srcdir)/sdcdbsrc.el $(DESTDIR)$(bindir)/sdcdbsrc.el
 
 
 # Deleting all the installed files
@@ -89,16 +96,19 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: $(SOURCES) *.h $(PRJDIR)/*.h
-       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
+Makefile.dep: $(SOURCES) $(SLIBSOURCES) $(SDCCSOURCES) $(srcdir)/*.h $(top_builddir)*.h $(top_srcdir)/*.h
+       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
 
-include Makefile.dep
-include clean.mk
+ifeq "$(findstring $(MAKECMDGOALS),uninstall installcheck installdirs checkconf \
+                                   clean distclean mostlyclean realclean)" ""
+  include Makefile.dep
+endif
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
-$(TARGET): $(OBJECTS) $(SLIBOBJS)
-       $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SLIBOBJS) $(LIBDIRS) $(LIBS)
+$(TARGET): $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS)
+       $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS) $(LIBDIRS) $(LIBS)
 
 .c.o:
        $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
@@ -106,11 +116,14 @@ $(TARGET): $(OBJECTS) $(SLIBOBJS)
 $(SLIBOBJS):%.o:$(SLIB)/%.c
        $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
 
+$(SDCCOBJS):%.o:$(SDCCLIB)/%.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-          $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+          $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
         fi
 
 # End of cpp/Makefile
index 6c54d98c86614f6ae9151292c1c2c015a2dc0979..5f3f6637a91c780f1630366f359e3b6f2a384c0a 100644 (file)
@@ -1,12 +1,9 @@
 # Deleting all files created by building the program
 # --------------------------------------------------
-PRJDIR = ../..
-
 clean:
        rm -f *core *[%~] *.[oa]
        rm -f .[a-z]*~
-       rm -f $(PRJDIR)/bin/sdcdb$(EXEEXT) \
-       $(PRJDIR)/support/Util/SDCCerr.o
+       rm -f $(top_builddir)bin/sdcdb$(EXEEXT)
 
 # Deleting all files created by configuring or building the program
 # -----------------------------------------------------------------
index 879e9bc8ad388e192c0c0849fde78cd7cba43a4f..ac65f24e50330b37d67254e462848ec49ec1d299 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of conf.mk
index 4abdeead2628528615b1304d07d718a89702f7ac..3d54c0b8cd4a4510a2a42bd7d29f654a93fa40fd 100644 (file)
@@ -8,7 +8,7 @@ normal :
        sdcc -mds390 --model-large test390.c
 
 clean:
-       rm mon.ihx *.lst *.rel *.rst *.sym *.cdb *.map *.ihx *.lnk *.asm
+       rm -f mon.ihx *.lst *.rel *.rst *.sym *.cdb *.map *.ihx *.lnk *.asm
 
 sim:
        ./s51 -t DS390F -Sout=test.lst test390.ihx
index 70fb7a6693d1e74caf98f6e287e9089ffdbdd9a3..711920875fc83c07c5a85ba8af35987e3eb436ac 100644 (file)
@@ -12,7 +12,8 @@ CPP             = @CPP@
 INSTALL         = @INSTALL@
 CP              = @CP@
 
-PRJDIR          = ..
+top_builddir    = @top_builddir@
+top_srcdir      = @top_srcdir@
 
 prefix          = @prefix@
 exec_prefix     = @exec_prefix@
@@ -24,13 +25,14 @@ mandir          = @mandir@
 man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
+VPATH           = @srcdir@
 srcdir          = @srcdir@
 
 include_dir_suffix = @include_dir_suffix@
 
 sdcc_includedir    = $(DESTDIR)$(datadir)/$(include_dir_suffix)
 
-CPPFLAGS        = @CPPFLAGS@ -I$(PRJDIR)
+CPPFLAGS        = @CPPFLAGS@ -I$(top_builddir)
 
 
 # Compiling entire program or any subproject
@@ -40,23 +42,26 @@ all:
 # Compiling and installing everything and running test
 # ----------------------------------------------------
 install: all installdirs
-       $(CP) -r asm *.h $(sdcc_includedir)
-       if [ "`grep mcs51 ../../ports.build`" = mcs51 ]; then \
-               $(CP) mcs51/*.h $(sdcc_includedir)/mcs51 ; \
+       $(CP) -r $(srcdir)/asm $(srcdir)/*.h $(sdcc_includedir)
+       if [ "`grep mcs51 $(top_builddir)ports.build`" = mcs51 ]; then \
+               $(CP) $(srcdir)/mcs51/*.h $(sdcc_includedir)/mcs51 ; \
        fi
-       if [ "`grep '^pic$$' ../../ports.build`" = pic ]; then \
-               $(CP) pic/*.h pic/*.inc pic/*.txt $(sdcc_includedir)/pic ; \
+       if [ "`grep '^pic$$' $(top_builddir)ports.build`" = pic ]; then \
+               $(CP) $(srcdir)/pic/*.h $(sdcc_includedir)/pic ; \
+               $(CP) $(srcdir)/pic/pic14devices.txt $(sdcc_includedir)/pic ; \
        fi
-       if [ "`grep pic16 ../../ports.build`" = pic16 ]; then \
-               $(CP) pic16/*.h $(sdcc_includedir)/pic16 ; \
+       if [ "`grep pic16 $(top_builddir)ports.build`" = pic16 ]; then \
+               $(CP) $(srcdir)/pic16/*.h $(sdcc_includedir)/pic16 ; \
        fi
-       if [ "`grep z80 ../../ports.build`" = z80 ]; then \
-               $(CP) z80/*.h $(sdcc_includedir)/z80 ; \
+       if [ "`grep z80 $(top_builddir)ports.build`" = z80 ]; then \
+               $(CP) $(srcdir)/z80/*.h $(sdcc_includedir)/z80 ; \
        fi
-       if [ "`grep hc08 ../../ports.build`" = hc08 ]; then \
-               $(CP) hc08/*.h $(sdcc_includedir)/hc08 ; \
+       if [ "`grep hc08 $(top_builddir)ports.build`" = hc08 ]; then \
+               $(CP) $(srcdir)/hc08/*.h $(sdcc_includedir)/hc08 ; \
        fi
        rm -rf `find $(sdcc_includedir) -type d -name '.svn'`
+       # some files in CVS are executable :-(
+       find $(sdcc_includedir) -type f -exec chmod 644 {} \;
 
 
 # Deleting all the installed files
@@ -94,7 +99,7 @@ dep: #Makefile.dep
 #      $(CPP) $(CPPFLAGS) $(M_OR_MM) *.c >main.dep
 
 #include Makefile.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
@@ -103,8 +108,8 @@ include clean.mk
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" \
          freshconf;\
        fi
 
index 879e9bc8ad388e192c0c0849fde78cd7cba43a4f..ac65f24e50330b37d67254e462848ec49ec1d299 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of conf.mk
index 424d841fc9281ead67d4e0fb5d3884eca89ec6c7..ca53e7139334616b8da136de8304a79d3f223786 100644 (file)
@@ -18,14 +18,17 @@ else
 CP_U   = $(CP)
 endif
 
-PRJDIR         = ../..
-INCDIR         = $(PRJDIR)/device/include
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
+VPATH           = @srcdir@
+srcdir          = @srcdir@
+INCDIR         = $(top_srcdir)/device/include
 ifndef PORTINCDIR
-PORTINCDIR     = $(INCDIR)/mcs51
+PORTINCDIR     = $(srcdir)/$(INCDIR)/mcs51
 endif
 
-CC             = $(PRJDIR)/bin/sdcc
-CPP            = $(PRJDIR)/bin/sdcpp
+CC             = $(top_builddir)bin/sdcc
+CPP            = $(top_builddir)bin/sdcpp
 
 prefix          = @prefix@
 exec_prefix     = @exec_prefix@
@@ -37,7 +40,6 @@ mandir          = @mandir@
 man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
-srcdir          = @srcdir@
 
 lib_dir_suffix  = @lib_dir_suffix@
 
@@ -53,6 +55,16 @@ ifndef PORTDIR
 PORTDIR         = $(BUILDDIR)/$(PORT)
 endif
 
+OPT_DISABLE_AVR   = @OPT_DISABLE_AVR@
+OPT_DISABLE_DS390 = @OPT_DISABLE_DS390@
+OPT_DISABLE_DS400 = @OPT_DISABLE_DS400@
+OPT_DISABLE_HC08  = @OPT_DISABLE_HC08@
+OPT_DISABLE_MCS51 = @OPT_DISABLE_MCS51@
+OPT_DISABLE_PIC   = @OPT_DISABLE_PIC@
+OPT_DISABLE_PIC16 = @OPT_DISABLE_PIC16@
+OPT_DISABLE_XA51  = @OPT_DISABLE_XA51@
+OPT_DISABLE_Z80   = @OPT_DISABLE_Z80@
+
 SOURCES                = _atof.c _atoi.c _atol.c _autobaud.c _bp.c _schar2fs.c \
                  _decdptr.c _divsint.c _divslong.c _divuint.c \
                  _divulong.c _fs2schar.c _fs2sint.c _fs2slong.c \
@@ -174,52 +186,81 @@ HC08OBJECTS       = $(patsubst %.c,$(PORTDIR)/%.rel,$(HC08SOURCES))
 
 OEXT            = .rel
 
-include incl.mk
+include $(srcdir)/incl.mk
+
+ifeq ($(OPT_DISABLE_DS390), 0)
+TARGETS        += model-ds390
+endif
+
+ifeq ($(OPT_DISABLE_DS400), 0)
+TARGETS        += model-ds400
+endif
+
+ifeq ($(OPT_DISABLE_HC08), 0)
+TARGETS        += model-hc08
+endif
+
+ifeq ($(OPT_DISABLE_MCS51), 0)
+TARGETS        += models small-mcs51-stack-auto
+endif
+
+ifeq ($(OPT_DISABLE_PIC), 0)
+TARGETS        += model-pic14
+endif
+
+ifeq ($(OPT_DISABLE_PIC16), 0)
+TARGETS        += model-pic16
+endif
+
+ifeq ($(OPT_DISABLE_Z80), 0)
+TARGETS        += model-z80 model-gbz80
+endif
+
 
 # Compiling entire program or any subproject
 # ------------------------------------------
-all: checkconf models small-mcs51-stack-auto model-ds390 model-ds400 model-z80 model-gbz80 model-hc08 model-pic16 model-pic14
+all: checkconf $(TARGETS)
 
 objects: build-dir $(OBJECTS) port-specific-objects lib-files clean_intermediate
 
 models:
-       if [ "`grep mcs51 ../../ports.build`" = mcs51 ]; then \
+       if [ "`grep mcs51 $(top_builddir)ports.build`" = mcs51 ]; then \
          for model in $(MODELS); do \
            $(MAKE) MODELFLAGS="--model-$$model" PORT=$$model PORTINCDIR=$(INCDIR)/mcs51 objects; \
          done \
        fi
 
 small-mcs51-stack-auto:
-       if [ "`grep mcs51 ../../ports.build`" = mcs51 ]; then \
+       if [ "`grep mcs51 $(top_builddir)ports.build`" = mcs51 ]; then \
          $(MAKE) MODELFLAGS="--model-small --stack-auto" PORT=small PORTDIR=$(BUILDDIR)/small-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects; \
        fi
 
 model-mcs51-stack-auto:
-       if [ "`grep mcs51 ../../ports.build`" = mcs51 ]; then \
+       if [ "`grep mcs51 $(top_builddir)ports.build`" = mcs51 ]; then \
          for model in $(MODELS); do \
            $(MAKE) MODELFLAGS="--model-$$model --stack-auto" PORT=$$model PORTDIR=$(BUILDDIR)/$$model-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects; \
          done \
        fi
 
 model-mcs51-xstack-auto:
-       if [ "`grep mcs51 ../../ports.build`" = mcs51 ]; then \
+       if [ "`grep mcs51 $(top_builddir)ports.build`" = mcs51 ]; then \
          for model in $(MODELS); do \
            $(MAKE) MODELFLAGS="--model-$$model --stack-auto --xstack" PORT=$$model PORTDIR=$(BUILDDIR)/$$model-xstack-auto PORTINCDIR=$(INCDIR)/mcs51 objects; \
          done \
        fi
 
 model-ds390:
-       if [ "`grep ds390 ../../ports.build`" = ds390 ]; then \
+       if [ "`grep ds390 $(top_builddir)ports.build`" = ds390 ]; then \
          $(MAKE) MODELFLAGS="-mds390" PORT=ds390 PORTINCDIR=$(INCDIR)/mcs51 objects; \
        fi
 
 model-ds400:
-       if [ "`grep ds400 ../../ports.build`" = ds400 ]; then \
+       if [ "`grep ds400 $(top_builddir)ports.build`" = ds400 ]; then \
          $(MAKE) MODELFLAGS="-mds400" PORT=ds400 PORTINCDIR=$(INCDIR)/mcs51 objects; \
        fi
 
 model-xa51:
-       if [ "`grep xa51 ../../ports.build`" = xa51 ]; then \
+       if [ "`grep xa51 $(top_builddir)ports.build`" = xa51 ]; then \
          $(MAKE) MODELFLAGS="-mxa51" PORT=xa51 objects-xa51; \
        fi
 
@@ -227,12 +268,12 @@ objects-xa51: build-dir $(XA51OBJECTS) port-specific-objects
        cd $(PORTDIR); ls *$(OEXT) > lib$(PORT).lib
 
 model-z80:
-       if [ "`grep z80 ../../ports.build`" = z80 ]; then \
+       if [ "`grep z80 $(top_builddir)ports.build`" = z80 ]; then \
          $(MAKE) MODELFLAGS="-mz80" PORT=z80 objects-z80 OEXT=.o; \
        fi
 
 model-gbz80:
-       if [ "`grep z80 ../../ports.build`" = z80 ]; then \
+       if [ "`grep z80 $(top_builddir)ports.build`" = z80 ]; then \
          $(MAKE) MODELFLAGS="-mgbz80" PORT=gbz80 objects-z80 OEXT=.o; \
        fi
 
@@ -240,7 +281,7 @@ objects-z80: build-dir $(Z80OBJECTS) port-specific-objects clean_intermediate
        cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
 
 model-hc08:
-       if [ "`grep hc08 ../../ports.build`" = hc08 ]; then \
+       if [ "`grep hc08 $(top_builddir)ports.build`" = hc08 ]; then \
          $(MAKE) MODELFLAGS="-mhc08" PORT=hc08 objects-hc08; \
        fi
 
@@ -248,7 +289,7 @@ objects-hc08: build-dir $(HC08OBJECTS) port-specific-objects clean_intermediate
        cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
 
 model-pic16:
-       if [ "`grep pic16 ../../ports.build`" = pic16 ]; then \
+       if [ "`grep pic16 $(top_builddir)ports.build`" = pic16 ]; then \
          $(MAKE) MODELFLAGS="-mpic16" PORT=pic16 OEXT=.lib objects-pic16; \
        fi
 
@@ -257,7 +298,7 @@ objects-pic16: build-dir port-specific-objects-pic16 clean_intermediate-pic16
 
 # yes, we do reuse the *-pic16 rules for pic14
 model-pic14:
-       if [ "`grep pic ../../ports.build | grep -v pic16`" = pic ]; then \
+       if [ "`grep pic $(top_builddir)ports.build | grep -v pic16`" = pic ]; then \
          $(MAKE) MODELFLAGS="-mpic14" PORT=pic OEXT=.lib objects-pic16; \
        fi
 
@@ -267,20 +308,20 @@ $(PORTDIR):
        mkdir -p $(PORTDIR)
 
 port-specific-objects:
-       if [ -d $(PORT) ]; then \
+       if [ -f $(PORT)/Makefile ]; then \
          $(MAKE) -C $(PORT); \
          cp -f $(PORT)/*.lib $(PORT)/*$(OEXT) $(PORTDIR); \
        fi
 
 port-specific-objects-pic16:
-       -if [ -d $(PORT) ]; then \
+       -if [ -f $(PORT)/Makefile ]; then \
          mkdir -p $(PORT)/bin; \
          $(MAKE) -C $(PORT); \
          cp -f $(PORT)/bin/*.* $(PORTDIR); \
        fi
 
 lib-files:
-       cp *.lib $(PORTDIR)
+       cp $(srcdir)/*.lib $(PORTDIR)
 
 clean_intermediate:
        rm -f $(PORTDIR)/*.lst $(PORTDIR)/*.sym
@@ -292,16 +333,22 @@ clean_intermediate-pic16:
 # ---------------------------------------------------
 install: all installdirs
        $(CP_U) -r $(BUILDDIR)/* $(sdcc_libdir)
-       $(CP_U) -r $(MODELS) mcs51 ds390 ds400 gbz80 z80 hc08 pic pic16 *.c $(sdcc_libdir)/src
-       for srcdir in $(MODELS) ds390 ds400 gbz80 z80 hc08 pic pic16; do \
-         find $(sdcc_libdir)/src/$$srcdir -depth \
+       $(CP_U) -r $(MODELS) $(srcdir)/mcs51 $(srcdir)/ds390 $(srcdir)/ds400 \
+                            $(srcdir)/gbz80 $(srcdir)/z80 $(srcdir)/hc08 \
+                            $(srcdir)/pic $(srcdir)/pic16 $(srcdir)/*.c $(sdcc_libdir)/src
+       $(CP_U) -r $(MODELS) mcs51 ds390 ds400 gbz80 z80 hc08 $(sdcc_libdir)/src
+
+       for src in $(MODELS) ds390 ds400 gbz80 z80 hc08 pic pic16; do \
+         find $(sdcc_libdir)/src/$$src -depth \
            \( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
-           -name '*.lst' -o -name '*.asm' -o -name '.svn' -o -name 'build' -o -name 'bin' \) \
+           -name '*.lst' -o -name '*.asm' -o -name '.svn' -o -name 'build' -o -name 'bin' -o \
+           -name 'Makefile*' \) \
            -exec rm -r {} \; ; \
        done
        find $(sdcc_libdir)/src/mcs51 -depth \
          \( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
-         -name '*.lst' -o -name '.svn' -o -name 'build' -o -name 'bin' \) \
+         -name '*.lst' -o -name '.svn' -o -name 'build' -o -name 'bin' -o \
+         -name 'Makefile*' \) \
          -exec rm -r {} \;
 
 # Deleting all the installed files
@@ -338,14 +385,17 @@ dep: Makefile.dep
 
 Makefile.dep: $(SOURCES) $(INCDIR)/*.h $(PORTINCDIR)/*.h
        rm -f Makefile.dep
-       for i in $(SOURCES); do \
+       for i in $(filter %.c,$^); do \
          $(CPP) -std=c99 -M $(CPPFLAGS) $$i >$${i}.dep; \
          cat $${i}.dep >>Makefile.dep; \
          rm $${i}.dep; \
        done
 
-include Makefile.dep
-include clean.mk
+ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \
+                                   clean distclean mostlyclean realclean)" ""
+  include Makefile.dep
+endif
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
@@ -358,8 +408,8 @@ $(PORTDIR)/%$(OEXT): %.c
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" \
          freshconf;\
        fi
 
index 12c8e4c8ef567ec7d11298ea10f5507c85d72722..2f0867b0417e6fce9ff5cee1771a170d52b75419 100644 (file)
@@ -1,4 +1,5 @@
-include incl.mk
+CLEANALLPORTS = ds390 ds400 gbz80 hc08 large mcs51 medium pic pic16 small z80
+include $(srcdir)/incl.mk
 
 # Deleting all files created by building the program
 # --------------------------------------------------
@@ -9,22 +10,25 @@ clean:
        rm -rf build
        for model in $(MODELS); do \
          if [ -d $$model ]; then \
-           cd $$model && for name in *; do if [ -f $$name -a $$name != Makefile ]; then rm $$name; fi; done; \
+           cd $$model && for name in *; do if [ -f $$name -a $$name != Makefile -a $$name != Makefile.in ]; then rm $$name; fi; done; \
          fi; \
        done
-       make -C mcs51 clean
-       make -C ds390 clean
-       make -C z80 clean
-       make -C gbz80 clean
-       make -C hc08 clean
-       make -C pic16 clean
-       make -C pic clean
+       for port in $(CLEANALLPORTS) ; do\
+         if [ -f $$port/Makefile ]; then\
+           $(MAKE) -C $$port clean ;\
+         fi\
+       done
+
 
 # Deleting all files created by configuring or building the program
 # -----------------------------------------------------------------
 distclean: clean
        rm -f Makefile *.dep
-       rm -f ds390/*.dep
+       for port in $(CLEANALLPORTS) ; do\
+         if [ -f $$port/Makefile ]; then\
+           $(MAKE) -C $$port distclean ;\
+         fi\
+       done
 
 # Like clean but some files may still exist
 # -----------------------------------------
index 879e9bc8ad388e192c0c0849fde78cd7cba43a4f..ac65f24e50330b37d67254e462848ec49ec1d299 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of conf.mk
diff --git a/device/lib/ds390/Makefile b/device/lib/ds390/Makefile
deleted file mode 100755 (executable)
index 1f23e4b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-CC = ../../../bin/sdcc
-
-#VERBOSE = --verbose
-
-OBJECTS = tinibios.rel memcpyx.rel  lcd390.rel i2c390.rel rtc390.rel
-
-SOURCES = $(patsubst %.rel,%.c,$(OBJECTS))
-
-CPPFLAGS = -I../../include
-CFLAGS = -mds390 $(CPPFLAGS) $(VERBOSE)
-
-all: $(OBJECTS) libds390.lib
-
-clean:
-       rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex 
-       rm -f *.ihx temp.lnk *.map *.lib
-
-superclean:
-       make clean ; rm Makefile.dep
-
-libds390.lib: $(OBJECTS)
-       rm -f $@; \
-       for libfile in $(OBJECTS); do \
-               echo $$libfile >>$@; \
-       done;
-
-%.rel: %.c
-       $(CC) -c $(CFLAGS) $<
-
-# Creating dependencies
-# ---------------------
-depend: Makefile.dep
-
-Makefile.dep: $(SOURCES)
-       rm -f Makefile.dep
-       for i in $(SOURCES); do \
-         $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \
-         cat $${i}.dep >>Makefile.dep; \
-         rm $${i}.dep; \
-       done
-
-include Makefile.dep
diff --git a/device/lib/ds390/Makefile.in b/device/lib/ds390/Makefile.in
new file mode 100755 (executable)
index 0000000..e5ab78c
--- /dev/null
@@ -0,0 +1,47 @@
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+CC = ../../../bin/sdcc
+
+#VERBOSE = --verbose
+
+OBJECTS = tinibios.rel memcpyx.rel  lcd390.rel i2c390.rel rtc390.rel
+
+SOURCES = $(patsubst %.rel,%.c,$(OBJECTS))
+
+CPPFLAGS = -I../../include
+CFLAGS = -mds390 $(CPPFLAGS) $(VERBOSE)
+
+all: $(OBJECTS) libds390.lib
+
+clean:
+       rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex 
+       rm -f *.ihx temp.lnk *.map *.lib
+
+distclean: clean
+       rm -f Makefile Makefile.dep
+
+libds390.lib: $(OBJECTS)
+       rm -f $@; \
+       for libfile in $(OBJECTS); do \
+               echo $$libfile >>$@; \
+       done;
+
+%.rel: %.c
+       $(CC) -c $(CFLAGS) $<
+
+# Creating dependencies
+# ---------------------
+depend: Makefile.dep
+
+Makefile.dep: $(SOURCES)
+       rm -f Makefile.dep
+       for i in $^; do \
+         $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \
+         cat $${i}.dep >>Makefile.dep; \
+         rm $${i}.dep; \
+       done
+
+ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""
+  include Makefile.dep
+endif
diff --git a/device/lib/ds400/Makefile b/device/lib/ds400/Makefile
deleted file mode 100755 (executable)
index 7925d03..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-CC = ../../../bin/sdcc
-
-#VERBOSE = --verbose
-
-OBJECTS = tinibios.rel memcpyx.rel ds400rom.rel
-
-SOURCES = $(patsubst %.rel,%.c,$(OBJECTS))
-
-CPPFLAGS = -I../../include
-CFLAGS = -mds400 $(CPPFLAGS) $(VERBOSE)
-
-all: $(OBJECTS) libds400.lib
-
-clean:
-       rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex 
-       rm -f *.ihx temp.lnk *.map *.lib
-
-superclean:
-       make clean ; rm Makefile.dep
-
-libds400.lib: $(OBJECTS)
-       rm -f $@; \
-       for libfile in $(OBJECTS); do \
-               echo $$libfile >>$@; \
-       done;
-
-%.rel: %.c
-       $(CC) -c $(CFLAGS) $<
-
-# Creating dependencies
-# ---------------------
-depend: Makefile.dep
-
-Makefile.dep: $(SOURCES)
-       rm -f Makefile.dep
-       for i in $(SOURCES); do \
-         $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \
-         cat $${i}.dep >>Makefile.dep; \
-         rm $${i}.dep; \
-       done
-
-include Makefile.dep
diff --git a/device/lib/ds400/Makefile.in b/device/lib/ds400/Makefile.in
new file mode 100755 (executable)
index 0000000..c1e3752
--- /dev/null
@@ -0,0 +1,47 @@
+CC = ../../../bin/sdcc
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+#VERBOSE = --verbose
+
+OBJECTS = tinibios.rel memcpyx.rel ds400rom.rel
+
+SOURCES = $(patsubst %.rel,%.c,$(OBJECTS))
+
+CPPFLAGS = -I../../include
+CFLAGS = -mds400 $(CPPFLAGS) $(VERBOSE)
+
+all: $(OBJECTS) libds400.lib
+
+clean:
+       rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex 
+       rm -f *.ihx temp.lnk *.map *.lib
+
+distclean: clean
+       rm -f Makefile Makefile.dep
+
+libds400.lib: $(OBJECTS)
+       rm -f $@; \
+       for libfile in $(OBJECTS); do \
+               echo $$libfile >>$@; \
+       done;
+
+%.rel: %.c
+       $(CC) -c $(CFLAGS) $<
+
+# Creating dependencies
+# ---------------------
+depend: Makefile.dep
+
+Makefile.dep: $(SOURCES)
+       rm -f Makefile.dep
+       for i in $^; do \
+         $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \
+         cat $${i}.dep >>Makefile.dep; \
+         rm $${i}.dep; \
+       done
+
+ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""
+  include Makefile.dep
+endif
diff --git a/device/lib/gbz80/Makefile b/device/lib/gbz80/Makefile
deleted file mode 100644 (file)
index e41c61f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# libc/z80 Makefile
-
-TOPDIR = ../../..
-
-SCC = $(TOPDIR)/bin/sdcc -mgbz80
-SAS = $(TOPDIR)/bin/as-gbz80
-
-OBJ = div.o mul.o putchar.o printf.o shift.o stubs.o crt0_rle.o heap.o fstubs.o
-
-LIB = gbz80.lib
-CC = $(SCC)
-AS = $(SAS)
-CFLAGS = -I../../include -I.
-
-all: $(LIB) crt0.o
-
-$(LIB): $(OBJ) Makefile _dummy
-       rm -f $(LIB)
-       for i in $(OBJ); do echo $$i >> $(LIB); done
-
-.c.o:
-       $(CC) $(CFLAGS) -c $<
-
-_dummy:
-
-clean:
-       rm -f *.o *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib
diff --git a/device/lib/gbz80/Makefile.in b/device/lib/gbz80/Makefile.in
new file mode 100644 (file)
index 0000000..39d65de
--- /dev/null
@@ -0,0 +1,33 @@
+# libc/z80 Makefile
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+TOPDIR = ../../..
+
+SCC = $(TOPDIR)/bin/sdcc -mgbz80
+SAS = $(TOPDIR)/bin/as-gbz80
+
+OBJ = div.o mul.o putchar.o printf.o shift.o stubs.o crt0_rle.o heap.o fstubs.o
+
+LIB = gbz80.lib
+CC = $(SCC)
+AS = $(SAS)
+CFLAGS = -I../../include -I.
+
+all: $(LIB) crt0.o
+
+$(LIB): $(OBJ) Makefile _dummy
+       rm -f $(LIB)
+       for i in $(OBJ); do echo $$i >> $(LIB); done
+
+.c.o:
+       $(CC) $(CFLAGS) -c $<
+
+_dummy:
+
+clean:
+       rm -f *.o *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib
+
+distclean: clean
+       rm -f Makefile
\ No newline at end of file
diff --git a/device/lib/hc08/Makefile b/device/lib/hc08/Makefile
deleted file mode 100644 (file)
index baded10..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# libc/hc08 Makefile
-
-TOPDIR = ../../..
-
-SCC = $(TOPDIR)/bin/sdcc -mhc08
-SAS = $(TOPDIR)/bin/as6808
-
-OBJ = _ret.rel _divuint.rel _divulong.rel _mulint.rel _mullong.rel
-
-LIB = hc08.lib
-CC = $(SCC)
-AS = $(SAS)
-ASFLAGS = -plosgff
-
-CFLAGS = -I../../include -I.
-
-all: $(LIB)
-
-$(LIB): $(OBJ) Makefile _dummy
-       rm -f $(LIB)
-       for i in $(OBJ); do echo $$i >> $(LIB); done
-
-%.rel: %.c
-       $(CC) $(CFLAGS) -c $<
-
-%.rel: %.asm
-       $(AS) $(ASFLAGS) $@ $<
-
-_dummy:
-
-clean:
-       rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib
diff --git a/device/lib/hc08/Makefile.in b/device/lib/hc08/Makefile.in
new file mode 100644 (file)
index 0000000..844b120
--- /dev/null
@@ -0,0 +1,38 @@
+# libc/hc08 Makefile
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+TOPDIR = ../../..
+
+SCC = $(TOPDIR)/bin/sdcc -mhc08
+SAS = $(TOPDIR)/bin/as6808
+
+OBJ = _ret.rel _divuint.rel _divulong.rel _mulint.rel _mullong.rel
+
+LIB = hc08.lib
+CC = $(SCC)
+AS = $(SAS)
+ASFLAGS = -plosgff
+
+CFLAGS = -I../../include -I.
+
+all: $(LIB)
+
+$(LIB): $(OBJ) Makefile _dummy
+       rm -f $(LIB)
+       for i in $(OBJ); do echo $$i >> $(LIB); done
+
+%.rel: %.c
+       $(CC) $(CFLAGS) -c $<
+
+%.rel: %.asm
+       $(AS) $(ASFLAGS) $@ $<
+
+_dummy:
+
+clean:
+       rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib
+
+distclean: clean
+       rm -f Makefile
\ No newline at end of file
diff --git a/device/lib/large/Makefile b/device/lib/large/Makefile
deleted file mode 100644 (file)
index b576379..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# Dummy Makefile to get around Subversion
-all:
-       $(MAKE) -C ../mcs51 all
-       cp ../mcs51/*.rel ../mcs51/*.lib .
-       touch dummy.lib
-       touch dummy.rel
-
-clean:
-       rm *.rel *.lib
diff --git a/device/lib/large/Makefile.in b/device/lib/large/Makefile.in
new file mode 100644 (file)
index 0000000..4acca3f
--- /dev/null
@@ -0,0 +1,11 @@
+all:
+       $(MAKE) -C ../mcs51 all
+       cp ../mcs51/*.rel ../mcs51/*.lib .
+       touch dummy.lib
+       touch dummy.rel
+
+clean:
+       rm -f *.rel *.lib
+
+distclean: clean
+       rm -f Makefile
\ No newline at end of file
diff --git a/device/lib/mcs51/Makefile b/device/lib/mcs51/Makefile
deleted file mode 100644 (file)
index f0c2e6c..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-
-TOPDIR = ../../..
-
-SAS = $(TOPDIR)/bin/asx8051
-SCC = $(TOPDIR)/bin/sdcc
-
-OBJ = crtstart.rel crtxinit.rel crtxclear.rel crtclear.rel crtxstack.rel \
-      crtpagesfr.rel crtbank.rel
-
-LIB = mcs51.lib
-
-CC = $(SCC)
-AS = $(SAS)
-ASFLAGS = -plosgff
-
-CFLAGS = -I../../include -I.
-
-all: $(LIB)
-
-$(LIB): $(OBJ) Makefile
-       rm -f $(LIB)
-       for i in $(OBJ); do echo $$i >> $(LIB); done
-
-%.rel: %.c
-       $(CC) $(CFLAGS) -c $<
-
-%.rel: %.asm
-       $(AS) $(ASFLAGS) $<
-
-clean:
-       rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.lib
diff --git a/device/lib/mcs51/Makefile.in b/device/lib/mcs51/Makefile.in
new file mode 100644 (file)
index 0000000..29ce7c0
--- /dev/null
@@ -0,0 +1,40 @@
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+top_srcdir   = @top_srcdir@
+top_builddir = @top_builddir@
+
+SAS = $(top_builddir)bin/asx8051
+SCC = $(top_builddir)bin/sdcc
+
+OBJ = crtstart.rel crtxinit.rel crtxclear.rel crtclear.rel crtxstack.rel \
+      crtpagesfr.rel crtbank.rel
+
+LIB = mcs51.lib
+
+CC = $(SCC)
+AS = $(SAS)
+ASFLAGS = -plosgff
+
+CFLAGS = -I$(top_srcdir)/include
+
+all: $(LIB)
+
+$(LIB): $(OBJ) Makefile
+       rm -f $(LIB)
+       for i in $(OBJ); do echo $$i >> $(LIB); done
+
+%.rel: %.c
+       $(CC) $(CFLAGS) -c $<
+
+%.rel: %.asm
+       @# TODO: asx8051 should place it's output in the current dir
+       test $(srcdir) == . || cp $< .
+       -$(AS) $(ASFLAGS) $(notdir $<)
+       test $(srcdir) == . || rm $(notdir $<)
+
+clean:
+       rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.lib
+
+distclean: clean
+       rm -r Makefile
\ No newline at end of file
diff --git a/device/lib/medium/Makefile b/device/lib/medium/Makefile
deleted file mode 100644 (file)
index b576379..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# Dummy Makefile to get around Subversion
-all:
-       $(MAKE) -C ../mcs51 all
-       cp ../mcs51/*.rel ../mcs51/*.lib .
-       touch dummy.lib
-       touch dummy.rel
-
-clean:
-       rm *.rel *.lib
diff --git a/device/lib/medium/Makefile.in b/device/lib/medium/Makefile.in
new file mode 100644 (file)
index 0000000..4acca3f
--- /dev/null
@@ -0,0 +1,11 @@
+all:
+       $(MAKE) -C ../mcs51 all
+       cp ../mcs51/*.rel ../mcs51/*.lib .
+       touch dummy.lib
+       touch dummy.rel
+
+clean:
+       rm -f *.rel *.lib
+
+distclean: clean
+       rm -f Makefile
\ No newline at end of file
diff --git a/device/lib/pic/Makefile b/device/lib/pic/Makefile
deleted file mode 100644 (file)
index 2493bae..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-###########################################################
-### Makefile for the SDCC/PIC14 Library
-###
-### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
-###
-### The library is currently maintained by
-###    Raphael Neider <rneider@web.de>
-###
-### This file may be distributed under the terms of the the
-### GNU General Public License (GPL). See GPL for details.
-###
-### $Id$
-###
-
-topsrcdir = .
-
-include $(topsrcdir)/Makefile.common
-
-ifeq (:,$(findstring :,$(LD) $(AS) $(LIB)))
-
-.PHONY : all
-
-all % : 
-       @echo "gputils not found -- PIC14 library not built!"
-
-else
-
-SUBDIRS           = libsdcc libdev
-builddir   = build
-installdir = bin
-export installdir
-
-C_SRC = $(wildcard *.c)
-S_SRC = $(wildcard *.S)
-OBJS = $(C_SRC:.c=.o) $(S_SRC:.S=.o)
-
-.PHONY : all clean clean-intermediate install
-
-all : install
-
-install : recurse
-
-clean : recurse
-       $(Q)-$(RMDIR) "$(topsrcdir)/$(builddir)";
-
-clean-intermediate : recurse
-
-include $(topsrcdir)/Makefile.rules
-
-endif
index 1ba999ea44cbf6b711aba6ed940d47f27edb87ae..537a44e0af5c4d6740d43714fc7cdda14a69208c 100644 (file)
@@ -23,12 +23,13 @@ Q   ?= @            # be quiet
 
 #################################################
 ### compiler switches
-ARCH   ?= 877          # might be overwritten in libio
+# ARCH might be overwritten in libio
+ARCH   ?= 877
 
 CFLAGS ?=
 CFLAGS += -mpic14 -p16f$(ARCH)
 CFLAGS += --std-c99
-CFLAGS += -I. -I$(topsrcdir)/../../include/pic
+CFLAGS += -I. -I$(top_srcdir)/../../include/pic
 
 #################################################
 ### optimization flags
@@ -54,7 +55,8 @@ CFLAGS += --i-code-in-asm
 ### assembler switches
 ASFLAGS ?=
 ASFLAGS += -pp16f$(ARCH)
-ASFLAGS += -I$(topsrcdir)/../../include/pic
+ASFLAGS += -I$(top_srcdir)/../../include/pic
+ASFLAGS += -I. -I$(srcdir)
 
 #################################################
 ### linker switches
@@ -68,8 +70,8 @@ LIBFLAGS += -c
 
 #################################################
 ### programs to use
-CPP    = $(topsrcdir)/../../../bin/sdcpp
-CC     = $(topsrcdir)/../../../bin/sdcc
+CPP    = $(top_builddir)../../../bin/sdcpp
+CC     = $(top_builddir)../../../bin/sdcc
 AS     = @GPASM@
 LD     = @GPLINK@
 LIB    = @GPLIB@
diff --git a/device/lib/pic/Makefile.in b/device/lib/pic/Makefile.in
new file mode 100644 (file)
index 0000000..6eebdff
--- /dev/null
@@ -0,0 +1,57 @@
+###########################################################
+### Makefile for the SDCC/PIC14 Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The library is currently maintained by
+###    Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See GPL for details.
+###
+### $Id$
+###
+
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+include $(top_builddir)Makefile.common
+
+ifeq (:,$(findstring :,$(LD) $(AS) $(LIB)))
+
+.PHONY : all
+
+all % : 
+       @echo "gputils not found -- PIC14 library not built!"
+
+else
+
+SUBDIRS           = libsdcc
+builddir   = build
+installdir = bin
+export installdir
+
+C_SRC = $(notdir $(wildcard $(srcdir)/*.c))
+S_SRC = $(notdir $(wildcard $(srcdir)/*.S))
+OBJS = $(C_SRC:.c=.o) $(S_SRC:.S=.o)
+
+.PHONY : all clean clean-intermediate install
+
+all : install
+
+install : recurse
+
+clean : recurse
+       $(Q)-$(RMDIR) "$(top_builddir)$(builddir)"
+
+distclean: clean
+       rm -f Makefile
+
+clean-intermediate : recurse
+
+include $(top_srcdir)/Makefile.rules
+
+endif
index 452bb278a57a63256d0f623d7c6c88d6bbb48639..a7d2fbb235ca6de28bad1b54ddbe5b25c9475f33 100644 (file)
 ###
 
 # update dependencies
-$(topsrcdir)/$(builddir)/%.d : %.c
+$(top_builddir)$(builddir)/%.d : %.c
 ifndef SILENT
-       @echo "[  CPP  ] ==> $(patsubst $(topsrcdir)/%,%,$@)";
+       @echo "[  CPP  ] ==> $(patsubst $(top_builddir)%,%,$@)"
 endif
-       $(Q)$(CPP) $(CPPFLAGS) -o "$@" "$<";
+       $(Q)$(CPP) $(CPPFLAGS) -o "$@" "$<"
 
 # assemble
-$(topsrcdir)/$(builddir)/%.o : %.S
+$(top_builddir)$(builddir)/%.o : %.S
 ifndef SILENT
-       @echo "[  AS   ] ==> $(patsubst $(topsrcdir)/%,%,$@)";
+       @echo "[  AS   ] ==> $(patsubst $(top_builddir)%,%,$@)"
 endif
-       $(Q)$(CPP) $(CPPFLAGS) -P -o "$*.Spp" "$<";
-       $(Q)$(AS) $(ASFLAGS) -o "$@" -c "$*.Spp";
-       $(Q)$(RM) "$*.Spp";
+       $(Q)$(CPP) $(CPPFLAGS) -P -o "$*.Spp" "$<"
+       $(Q)$(AS) $(ASFLAGS) -o "$@" -c "$*.Spp"
+       $(Q)$(RM) "$*.Spp"
 
 # compile
-$(topsrcdir)/$(builddir)/%.o : %.c
+$(top_builddir)$(builddir)/%.o : %.c
 ifndef SILENT
-       @echo "[  CC   ] ==> $(patsubst $(topsrcdir)/%,%,$@)";
+       @echo "[  CC   ] ==> $(patsubst $(top_builddir)%,%,$@)"
 endif
-       $(Q)$(CC) $(CFLAGS) -o "$@" -c "$<";
+       $(Q)$(CC) $(CFLAGS) -o "$@" -c "$<"
 
 # create library
 ifneq (,$(strip $(LIB_O)))
 %.lib : $(LIB_O)
 ifndef SILENT
-       @echo "[  LIB  ] $(patsubst $(topsrcdir)/%,%,$@) <== $(patsubst $(topsrcdir)/$(builddir)/%,%,$^)";
+       @echo "[  LIB  ] $(patsubst $(top_builddir)%,%,$@) <== $(patsubst $(top_builddir)$(builddir)/%,%,$^)"
 endif
-       $(Q)$(RM) "$@"; $(LIB) $(LIBFLAGS) "$@" $^;
+       $(Q)$(RM) "$@"; $(LIB) $(LIBFLAGS) "$@" $^
 else
 %.lib : recurse
 ifndef SILENT
-       @echo "[  LIB  ] $(patsubst $(topsrcdir)/%,%,$@) <== **/*.o";
+       @echo "[  LIB  ] $(patsubst $(top_builddir)%,%,$@) <== **/*.o"
 endif
-       $(Q)$(RM) "$@"; LIB_O=`find "$(topsrcdir)/$(builddir)" -name "*.o"`; [ "x$${LIB_O}" = "x" ] || $(LIB) $(LIBFLAGS) "$@" $${LIB_O};
+       $(Q)$(RM) "$@"; LIB_O=`find "$(top_builddir)$(builddir)" -name "*.o"`; [ "x$${LIB_O}" = "x" ] || $(LIB) $(LIBFLAGS) "$@" $${LIB_O}
 endif
 
 .PHONY : recurse force
@@ -57,7 +57,7 @@ ifneq (,$(strip $(SUBDIRS)))
 recurse : force
        $(Q)+for DIR in $(SUBDIRS) ; do \
                $(GREP) "^$${ARCH}$$" "$${DIR}.ignore" &> /dev/null || ( \
-                       [ -d "$(topsrcdir)/$(builddir)/$${DIR}" ] || $(MKDIR) "$(topsrcdir)/$(builddir)/$${DIR}"; \
+                       $(MKDIR) "$(top_builddir)$(builddir)/$${DIR}"; \
                        $(MAKE) -C "$${DIR}" builddir="$(builddir)/$${DIR}" $(MAKECMDGOALS); \
                ) || exit 1; \
        done
index 1d228e3790deac08edf981a5e29efe2b36d22604..f771dc06fb287f57355687b98fbfe427bc1d0817 100644 (file)
 ### $Id$
 ###
 
-include $(topsrcdir)/Makefile.common
+include $(top_builddir)Makefile.common
 
 SUBDIRS ?= 
 MKLIB  ?= 
 
 # fallback: if builddir is not specified via the command line...
-builddir ?= build/$(patsubst $(shell cd $(topsrcdir); pwd)/%,%,$(CURDIR))
+builddir ?= build/$(patsubst $(shell cd $(top_srcdir); pwd)/%,%,$(CURDIR))
+
+C_SRC  ?= $(notdir $(wildcard $(srcdir)/*.c))
+S_SRC  ?= $(notdir $(wildcard $(srcdir)/*.S))
+OBJS   ?= $(addprefix $(top_builddir)$(builddir)/,$(C_SRC:%.c=%.o) $(S_SRC:%.S=%.o))
 
-C_SRC  ?= $(wildcard *.c)
-S_SRC  ?= $(wildcard *.S)
-OBJS   ?= $(addprefix $(topsrcdir)/$(builddir)/,$(C_SRC:.c=.o) $(S_SRC:.S=.o))
 LIB_O  ?= $(OBJS)
 
 ifneq (,$(strip $(MKLIB)))
-LIB_LIB = $(topsrcdir)/$(builddir)/$(MKLIB)
+LIB_LIB = $(top_builddir)$(builddir)/$(MKLIB)
 TARGETS ?= $(LIB_LIB)
 else
 LIB_LIB = 
@@ -40,11 +41,11 @@ all : install
 ifneq (,$(strip $(TARGETS)))
 # usually install $(LIB_LIB) or $(OBJS), race condition in "[ -d x ] || mkdir x"
 install : recurse $(OBJS) $(LIB_LIB)
-       @[ -d "$(topsrcdir)/$(installdir)" ] || ( $(MKDIR) "$(topsrcdir)/$(installdir)" || true );
+       -@$(MKDIR) "$(top_builddir)$(installdir)"
 ifndef SILENT
-       @echo "[INSTALL] $(patsubst $(topsrcdir)/$(builddir)/%,%,$(TARGETS))";
+       @echo "[INSTALL] $(patsubst $(top_builddir)$(builddir)/%,%,$(TARGETS))"
 endif
-       $(Q)$(CP) $(TARGETS) "$(topsrcdir)/$(installdir)"
+       $(Q)$(CP) $(TARGETS) "$(top_builddir)$(installdir)"
 else
 # used in subdirs like libc/ctype whose files
 # are contained in a parent's library
@@ -57,11 +58,11 @@ clean : recurse
        @-echo "dummy" > .dummy
        $(Q)-$(RM) .dummy $(OBJS) $(LIB_LIB)
        $(Q)-$(RM) $(TARGETS)
-       $(Q)-$(RM) $(addprefix $(topsrcdir)/$(installdir)/,$(notdir $(TARGETS)))
-       $(Q)-[ ! -d "$(topsrcdir)/$(builddir)" ] || $(RMDIR) "$(topsrcdir)/$(builddir)"
+       $(Q)-$(RM) $(addprefix $(top_builddir)$(installdir)/,$(notdir $(TARGETS)))
+       $(Q)-[ ! -d "$(top_builddir)$(builddir)" ] || $(RMDIR) "$(top_builddir)$(builddir)"
 
 clean-intermediate : recurse
        @-echo "dummy" > .dummy
        $(Q)-$(RM) .dummy $(foreach suf,p lst hex cod sym,$(OBJS:.o=.$(suf)))
        
-include $(topsrcdir)/Makefile.rules
+include $(top_srcdir)/Makefile.rules
index 483cd92e4ef7a1a2ba16a5f7f1df81c726286ec4..ec95ff6675eb1980792d0a8d4a231f212e5a6851 100755 (executable)
@@ -1633,7 +1633,8 @@ fi
 # Checks for typedefs, structures, and compiler characteristics.
 
 # Checks for library functions.
-                    ac_config_files="$ac_config_files Makefile.common libdev/Makefile"
+
+                                        ac_config_files="$ac_config_files Makefile Makefile.common libdev/Makefile libsdcc/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -2185,8 +2186,10 @@ for ac_config_target in $ac_config_targets
 do
   case "$ac_config_target" in
   # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common" ;;
   "libdev/Makefile" ) CONFIG_FILES="$CONFIG_FILES libdev/Makefile" ;;
+  "libsdcc/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsdcc/Makefile" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
index f0928a23033297c0b175cd931a2cf2c65b888293..1f7ecf4f0906369c2e4c5ae63c5f3ac54f53da7a 100644 (file)
@@ -43,6 +43,9 @@ AC_PROG_MAKE_SET
 # Checks for typedefs, structures, and compiler characteristics.
 
 # Checks for library functions.
-AC_CONFIG_FILES([Makefile.common
-       libdev/Makefile])
+
+AC_CONFIG_FILES([Makefile
+                 Makefile.common
+                 libdev/Makefile
+                 libsdcc/Makefile])
 AC_OUTPUT
diff --git a/device/lib/pic/libsdcc/Makefile b/device/lib/pic/libsdcc/Makefile
deleted file mode 100644 (file)
index 84b1639..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=..
-
-SUBDIRS = 
-MKLIB = libsdcc.lib
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic/libsdcc/Makefile.in b/device/lib/pic/libsdcc/Makefile.in
new file mode 100644 (file)
index 0000000..415ab18
--- /dev/null
@@ -0,0 +1,10 @@
+top_builddir=@top_builddir@
+top_srcdir=@top_srcdir@
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+SUBDIRS = 
+MKLIB = libsdcc.lib
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/Makefile b/device/lib/pic16/Makefile
deleted file mode 100644 (file)
index 002ef2a..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-###########################################################
-### Makefile for the GNU PIC Library
-###
-### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
-###
-### The GNU PIC Library was originally designed and
-### implemented by
-###    Vangelis Rokas <vrokas@otenet.gr>
-###
-### It is currently maintained by
-###    Raphael Neider <rneider@web.de>
-###
-### This file may be distributed under the terms of the the
-### GNU General Public License (GPL). See COPYING for details.
-###
-### $Id$
-###
-
-topsrcdir = .
-
-include $(topsrcdir)/Makefile.common
-
-ifeq (:,$(findstring :,$(LD) $(AS) $(LIB)))
-
-.PHONY : all
-
-all % : 
-       @echo "gputils not found -- PIC16 library not built!"
-
-else
-
-SUBDIRS           = debug libc libdev libio libm libsdcc startup
-builddir   = build
-installdir = bin
-export installdir
-
-C_SRC = $(wildcard *.c)
-S_SRC = $(wildcard *.S)
-OBJS = $(C_SRC:.c=.o) $(S_SRC:.S=.o)
-
-.PHONY : all clean clean-intermediate install
-
-all : install
-
-install : recurse
-
-clean : recurse
-       $(Q)-$(RMDIR) "$(topsrcdir)/$(builddir)";
-
-clean-intermediate : recurse
-
-include $(topsrcdir)/Makefile.rules
-
-endif
index 294ebd740187139b6b27767be38064aafef9239d..151b4b495186e79f7d8fff40cefaa6df7edbdbcf 100644 (file)
@@ -32,7 +32,7 @@ ARCH   ?= 452         # might be overwritten in libio
 CFLAGS ?=
 CFLAGS += -mpic16 -p18f$(ARCH)
 CFLAGS += --std-c99
-CFLAGS += -I. -I$(topsrcdir)/../../include/pic16
+CFLAGS += -I. -I$(top_srcdir)/../../include/pic16
 
 #################################################
 ### optimization flags
@@ -64,7 +64,8 @@ CFLAGS += --i-code-in-asm
 ### assembler switches
 ASFLAGS ?=
 ASFLAGS += -pp18f$(ARCH)
-ASFLAGS += -I$(topsrcdir)/../../include/pic16
+ASFLAGS += -I$(top_srcdir)/../../include/pic16
+ASFLAGS += -I$(srcdir)
 
 #################################################
 ### linker switches
@@ -78,8 +79,8 @@ LIBFLAGS += -c
 
 #################################################
 ### programs to use
-CPP    = $(topsrcdir)/../../../bin/sdcpp
-CC     = $(topsrcdir)/../../../bin/sdcc --asm=@GPASM@
+CPP    = $(top_builddir)../../../bin/sdcpp
+CC     = $(top_builddir)../../../bin/sdcc --asm=@GPASM@
 AS     = @GPASM@
 LD     = @GPLINK@
 LIB    = @GPLIB@
diff --git a/device/lib/pic16/Makefile.in b/device/lib/pic16/Makefile.in
new file mode 100644 (file)
index 0000000..de72a4f
--- /dev/null
@@ -0,0 +1,62 @@
+###########################################################
+### Makefile for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+###    Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+###    Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
+
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+top_pic16builddir = .
+
+include $(top_pic16builddir)/Makefile.common
+
+ifeq (:,$(findstring :,$(LD) $(AS) $(LIB)))
+
+.PHONY : all
+
+all % : 
+       @echo "gputils not found -- PIC16 library not built!"
+
+else
+
+SUBDIRS           = debug libc libdev libio libm libsdcc startup
+builddir   = build
+installdir = bin
+export installdir
+
+C_SRC = $(notdir $(wildcard $(srcdir)/*.c))
+S_SRC = $(notdir $(wildcard $(srcdir)/*.S))
+OBJS = $(C_SRC:.c=.o) $(S_SRC:.S=.o)
+
+.PHONY : all clean distclean clean-intermediate install
+
+all : install
+
+install : recurse
+
+clean : recurse
+       $(Q)-$(RMDIR) "$(top_pic16builddir)/$(builddir)"
+
+distclean: clean
+       $(RM) -f Makefile
+
+clean-intermediate : recurse
+
+include $(top_srcdir)/Makefile.rules
+
+endif
index 81e92e25137e048edacb89be4c74fc9311361be8..f3058419c827d2fb5e2f4df83c97945bc6922d74 100644 (file)
 ###
 
 # update dependencies
-$(topsrcdir)/$(builddir)/%.d : %.c
+$(top_builddir)$(builddir)/%.d : %.c
 ifndef SILENT
-       @echo "[  CPP  ] ==> $(patsubst $(topsrcdir)/%,%,$@)";
+       @echo "[  CPP  ] ==> $(patsubst $(top_builddir)%,%,$@)"
 endif
-       $(Q)$(CPP) $(CPPFLAGS) -o "$@" "$<";
+       $(Q)$(CPP) $(CPPFLAGS) -o "$@" "$<"
 
 # assemble
-$(topsrcdir)/$(builddir)/%.o : %.S
+$(top_builddir)$(builddir)/%.o : %.S
 ifndef SILENT
-       @echo "[  AS   ] ==> $(patsubst $(topsrcdir)/%,%,$@)";
+       @echo "[  AS   ] ==> $(patsubst $(top_builddir)%,%,$@)"
 endif
-       $(Q)$(AS) $(ASFLAGS) -o "$@" -c "$<";
+       $(Q)$(AS) $(ASFLAGS) -o "$@" -c "$<"
 
 # compile
-$(topsrcdir)/$(builddir)/%.o : %.c
+$(top_builddir)$(builddir)/%.o : %.c
 ifndef SILENT
-       @echo "[  CC   ] ==> $(patsubst $(topsrcdir)/%,%,$@)";
+       @echo "[  CC   ] ==> $(patsubst $(top_builddir)%,%,$@)"
 endif
-       $(Q)$(CC) $(CFLAGS) -o "$@" -c "$<";
+       $(Q)$(CC) $(CFLAGS) -o "$@" -c "$<"
 
 # create library
 ifneq (,$(strip $(LIB_O)))
 %.lib : $(LIB_O)
 ifndef SILENT
-       @echo "[  LIB  ] $(patsubst $(topsrcdir)/%,%,$@) <== $(patsubst $(topsrcdir)/$(builddir)/%,%,$^)";
+       @echo "[  LIB  ] $(patsubst $(top_builddir)%,%,$@) <== $(patsubst $(top_builddir)$(builddir)/%,%,$^)"
 endif
-       $(Q)$(RM) "$@"; $(LIB) $(LIBFLAGS) "$@" $^;
+       $(Q)$(RM) "$@"; $(LIB) $(LIBFLAGS) "$@" $^
 else
 %.lib : recurse
 ifndef SILENT
-       @echo "[  LIB  ] $(patsubst $(topsrcdir)/%,%,$@) <== **/*.o";
+       @echo "[  LIB  ] $(patsubst $(top_builddir)%,%,$@) <== **/*.o"
 endif
-       $(Q)$(RM) "$@"; LIB_O=`find "$(topsrcdir)/$(builddir)" -name "*.o"`; echo $${LIB_O}; [ "x$${LIB_O}" = "x" ] || $(LIB) $(LIBFLAGS) "$@" $${LIB_O};
+       $(Q)$(RM) "$@"; LIB_O=`find "$(top_builddir)$(builddir)" -name "*.o"`; echo $${LIB_O}; [ "x$${LIB_O}" = "x" ] || $(LIB) $(LIBFLAGS) "$@" $${LIB_O}
 endif
 
 .PHONY : recurse force
@@ -58,8 +58,8 @@ endif
 ifneq (,$(strip $(SUBDIRS)))
 recurse : force
        $(Q)+for DIR in $(SUBDIRS) ; do \
-               $(GREP) "^$${ARCH}$$" "$${DIR}.ignore" &> /dev/null || ( \
-                       [ -d "$(topsrcdir)/$(builddir)/$${DIR}" ] || $(MKDIR) "$(topsrcdir)/$(builddir)/$${DIR}"; \
+               $(GREP) "^$${ARCH}$$" "$(srcdir)/$${DIR}.ignore" &> /dev/null || ( \
+                       $(MKDIR) "$(top_builddir)$(builddir)/$${DIR}"; \
                        $(MAKE) -C "$${DIR}" builddir="$(builddir)/$${DIR}" $(MAKECMDGOALS); \
                ) || exit 1; \
        done
index 102973be19219377a0b100810defeaac85cc3445..63952b1dc93cb299ac3b40ec8bd3b985b7fc5034 100644 (file)
 ### $Id$
 ###
 
-include $(topsrcdir)/Makefile.common
+include $(top_builddir)Makefile.common
 
 SUBDIRS ?= 
 MKLIB  ?= 
 
 # fallback: if builddir is not specified via the command line...
-builddir ?= build/$(patsubst $(shell cd $(topsrcdir); pwd)/%,%,$(CURDIR))
+builddir ?= build/$(patsubst $(shell cd $(top_builddir); pwd)/%,%,$(CURDIR))
 
-C_SRC  ?= $(wildcard *.c)
-S_SRC  ?= $(wildcard *.S)
-OBJS   ?= $(addprefix $(topsrcdir)/$(builddir)/,$(C_SRC:.c=.o) $(S_SRC:.S=.o))
+C_SRC  ?= $(notdir $(wildcard $(srcdir)/*.c))
+S_SRC  ?= $(notdir $(wildcard $(srcdir)/*.S))
+OBJS   ?= $(addprefix $(top_builddir)$(builddir)/,$(C_SRC:.c=.o) $(S_SRC:.S=.o))
 LIB_O  ?= $(OBJS)
 
 ifneq (,$(strip $(MKLIB)))
-LIB_LIB = $(topsrcdir)/$(builddir)/$(MKLIB)
+LIB_LIB = $(top_builddir)$(builddir)/$(MKLIB)
 TARGETS ?= $(LIB_LIB)
 else
 LIB_LIB = 
@@ -44,11 +44,11 @@ all : install
 ifneq (,$(strip $(TARGETS)))
 # usually install $(LIB_LIB) or $(OBJS), race condition in "[ -d x ] || mkdir x"
 install : recurse $(OBJS) $(LIB_LIB)
-       @[ -d "$(topsrcdir)/$(installdir)" ] || ( $(MKDIR) "$(topsrcdir)/$(installdir)" || true );
+       @$(MKDIR) "$(top_builddir)$(installdir)"
 ifndef SILENT
-       @echo "[INSTALL] $(patsubst $(topsrcdir)/$(builddir)/%,%,$(TARGETS))";
+       @echo "[INSTALL] $(patsubst $(top_builddir)$(builddir)/%,%,$(TARGETS))";
 endif
-       $(Q)$(CP) $(TARGETS) "$(topsrcdir)/$(installdir)"
+       $(Q)$(CP) $(TARGETS) "$(top_builddir)$(installdir)"
 else
 # used in subdirs like libc/ctype whose files
 # are contained in a parent's library
@@ -63,11 +63,11 @@ clean : recurse
        @-echo "dummy" > .dummy
        $(Q)-$(RM) .dummy $(TARGETS)
        @-echo "dummy" > .dummy
-       $(Q)-$(RM) .dummy $(addprefix $(topsrcdir)/$(installdir)/,$(notdir $(TARGETS)))
-       $(Q)-[ ! -d "$(topsrcdir)/$(builddir)" ] || $(RMDIR) "$(topsrcdir)/$(builddir)"
+       $(Q)-$(RM) .dummy $(addprefix $(top_builddir)$(installdir)/,$(notdir $(TARGETS)))
+       $(Q)-[ ! -d "$(top_builddir)$(builddir)" ] || $(RMDIR) "$(top_builddir)$(builddir)"
 
 clean-intermediate : recurse
        @-echo "dummy" > .dummy
        $(Q)-$(RM) .dummy $(foreach suf,p lst hex cod sym,$(OBJS:.o=.$(suf)))
        
-include $(topsrcdir)/Makefile.rules
+include $(top_srcdir)/Makefile.rules
index cfd0e02312c9342f6f87368e664a81a688d20ded..4e955839bcc8cf06ba4516b163a028e5245695fd 100755 (executable)
@@ -1634,9 +1634,9 @@ fi
 
 # Checks for library functions.
 
-$CP pics.all pics.build
+$CP "$srcdir"/pics.all pics.build
 
-          ac_config_files="$ac_config_files Makefile.common"
+                                                                                                                                                                                                                                                                    ac_config_files="$ac_config_files Makefile Makefile.common debug/Makefile debug/gstack/Makefile libc/Makefile libc/ctype/Makefile libc/delay/Makefile libc/stdio/Makefile libc/stdlib/Makefile libc/string/Makefile libc/utils/Makefile libdev/Makefile libio/Makefile libio/adc/Makefile libio/i2c/Makefile libio/usart/Makefile libm/Makefile libsdcc/Makefile libsdcc/char/Makefile libsdcc/fixed16x16/Makefile libsdcc/float/Makefile libsdcc/gptr/Makefile libsdcc/int/Makefile libsdcc/long/Makefile libsdcc/lregs/Makefile startup/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -2188,7 +2188,32 @@ for ac_config_target in $ac_config_targets
 do
   case "$ac_config_target" in
   # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common" ;;
+  "debug/Makefile" ) CONFIG_FILES="$CONFIG_FILES debug/Makefile" ;;
+  "debug/gstack/Makefile" ) CONFIG_FILES="$CONFIG_FILES debug/gstack/Makefile" ;;
+  "libc/Makefile" ) CONFIG_FILES="$CONFIG_FILES libc/Makefile" ;;
+  "libc/ctype/Makefile" ) CONFIG_FILES="$CONFIG_FILES libc/ctype/Makefile" ;;
+  "libc/delay/Makefile" ) CONFIG_FILES="$CONFIG_FILES libc/delay/Makefile" ;;
+  "libc/stdio/Makefile" ) CONFIG_FILES="$CONFIG_FILES libc/stdio/Makefile" ;;
+  "libc/stdlib/Makefile" ) CONFIG_FILES="$CONFIG_FILES libc/stdlib/Makefile" ;;
+  "libc/string/Makefile" ) CONFIG_FILES="$CONFIG_FILES libc/string/Makefile" ;;
+  "libc/utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES libc/utils/Makefile" ;;
+  "libdev/Makefile" ) CONFIG_FILES="$CONFIG_FILES libdev/Makefile" ;;
+  "libio/Makefile" ) CONFIG_FILES="$CONFIG_FILES libio/Makefile" ;;
+  "libio/adc/Makefile" ) CONFIG_FILES="$CONFIG_FILES libio/adc/Makefile" ;;
+  "libio/i2c/Makefile" ) CONFIG_FILES="$CONFIG_FILES libio/i2c/Makefile" ;;
+  "libio/usart/Makefile" ) CONFIG_FILES="$CONFIG_FILES libio/usart/Makefile" ;;
+  "libm/Makefile" ) CONFIG_FILES="$CONFIG_FILES libm/Makefile" ;;
+  "libsdcc/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsdcc/Makefile" ;;
+  "libsdcc/char/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsdcc/char/Makefile" ;;
+  "libsdcc/fixed16x16/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsdcc/fixed16x16/Makefile" ;;
+  "libsdcc/float/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsdcc/float/Makefile" ;;
+  "libsdcc/gptr/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsdcc/gptr/Makefile" ;;
+  "libsdcc/int/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsdcc/int/Makefile" ;;
+  "libsdcc/long/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsdcc/long/Makefile" ;;
+  "libsdcc/lregs/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsdcc/lregs/Makefile" ;;
+  "startup/Makefile" ) CONFIG_FILES="$CONFIG_FILES startup/Makefile" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
index ac9b28eb276356e08643cc6c894c114f1f326ce6..d08d9e37b403b67112c4e1c8206862500b1d9be6 100644 (file)
@@ -42,7 +42,33 @@ AC_PROG_MAKE_SET
 
 # Checks for library functions.
 
-$CP pics.all pics.build
+$CP "$srcdir"/pics.all pics.build
 
-AC_CONFIG_FILES([Makefile.common])
+AC_CONFIG_FILES([Makefile
+                 Makefile.common
+                 debug/Makefile
+                 debug/gstack/Makefile
+                 libc/Makefile
+                 libc/ctype/Makefile
+                 libc/delay/Makefile
+                 libc/stdio/Makefile
+                 libc/stdlib/Makefile
+                 libc/string/Makefile
+                 libc/utils/Makefile
+                 libdev/Makefile
+                 libio/Makefile
+                 libio/adc/Makefile
+                 libio/i2c/Makefile
+                 libio/usart/Makefile
+                 libm/Makefile
+                 libsdcc/Makefile
+                 libsdcc/char/Makefile
+                 libsdcc/fixed16x16/Makefile
+                 libsdcc/float/Makefile
+                 libsdcc/gptr/Makefile
+                 libsdcc/int/Makefile
+                 libsdcc/long/Makefile
+                 libsdcc/lregs/Makefile
+                 startup/Makefile
+                 ])
 AC_OUTPUT
diff --git a/device/lib/pic16/debug/Makefile b/device/lib/pic16/debug/Makefile
deleted file mode 100644 (file)
index ce9d253..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=..
-
-SUBDIRS = gstack
-MKLIB = libdebug.lib
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/debug/Makefile.in b/device/lib/pic16/debug/Makefile.in
new file mode 100644 (file)
index 0000000..8736f33
--- /dev/null
@@ -0,0 +1,9 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = gstack
+MKLIB = libdebug.lib
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/debug/gstack/Makefile b/device/lib/pic16/debug/gstack/Makefile
deleted file mode 100644 (file)
index 87adf7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/debug/gstack/Makefile.in b/device/lib/pic16/debug/gstack/Makefile.in
new file mode 100644 (file)
index 0000000..02e8d0d
--- /dev/null
@@ -0,0 +1,9 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+SUBDIRS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/Makefile b/device/lib/pic16/libc/Makefile
deleted file mode 100644 (file)
index 29f0da7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=..
-
-SUBDIRS = ctype delay stdio stdlib string utils
-MKLIB  = libc18f.lib
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/Makefile.in b/device/lib/pic16/libc/Makefile.in
new file mode 100644 (file)
index 0000000..356bad6
--- /dev/null
@@ -0,0 +1,9 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = ctype delay stdio stdlib string utils
+MKLIB  = libc18f.lib
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/ctype/Makefile b/device/lib/pic16/libc/ctype/Makefile
deleted file mode 100644 (file)
index c682cda..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS =
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/ctype/Makefile.in b/device/lib/pic16/libc/ctype/Makefile.in
new file mode 100644 (file)
index 0000000..e2ea5f9
--- /dev/null
@@ -0,0 +1,8 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS =
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/delay/Makefile b/device/lib/pic16/libc/delay/Makefile
deleted file mode 100644 (file)
index c196350..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS =
-TARGETS =
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/delay/Makefile.in b/device/lib/pic16/libc/delay/Makefile.in
new file mode 100644 (file)
index 0000000..2c7d9d1
--- /dev/null
@@ -0,0 +1,10 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+SUBDIRS =
+TARGETS =
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/stdio/Makefile b/device/lib/pic16/libc/stdio/Makefile
deleted file mode 100644 (file)
index c196350..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS =
-TARGETS =
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/stdio/Makefile.in b/device/lib/pic16/libc/stdio/Makefile.in
new file mode 100644 (file)
index 0000000..2c7d9d1
--- /dev/null
@@ -0,0 +1,10 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+SUBDIRS =
+TARGETS =
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/stdlib/Makefile b/device/lib/pic16/libc/stdlib/Makefile
deleted file mode 100644 (file)
index c196350..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS =
-TARGETS =
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/stdlib/Makefile.in b/device/lib/pic16/libc/stdlib/Makefile.in
new file mode 100644 (file)
index 0000000..2c7d9d1
--- /dev/null
@@ -0,0 +1,10 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+SUBDIRS =
+TARGETS =
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/string/Makefile b/device/lib/pic16/libc/string/Makefile
deleted file mode 100644 (file)
index c196350..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS =
-TARGETS =
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/string/Makefile.in b/device/lib/pic16/libc/string/Makefile.in
new file mode 100644 (file)
index 0000000..2c7d9d1
--- /dev/null
@@ -0,0 +1,10 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+SUBDIRS =
+TARGETS =
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/utils/Makefile b/device/lib/pic16/libc/utils/Makefile
deleted file mode 100644 (file)
index c196350..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS =
-TARGETS =
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libc/utils/Makefile.in b/device/lib/pic16/libc/utils/Makefile.in
new file mode 100644 (file)
index 0000000..2c7d9d1
--- /dev/null
@@ -0,0 +1,10 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+SUBDIRS =
+TARGETS =
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libdev/Makefile b/device/lib/pic16/libdev/Makefile
deleted file mode 100644 (file)
index c56128b..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-###########################################################
-### Makefile for the GNU PIC Library
-###
-### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
-###
-### The GNU PIC Library was originally designed and
-### implemented by
-###    Vangelis Rokas <vrokas@otenet.gr>
-###
-### It is currently maintained by
-###    Raphael Neider <rneider@web.de>
-###
-### This file may be distributed under the terms of the the
-### GNU General Public License (GPL). See COPYING for details.
-###
-### $Id$
-###
-
-topsrcdir=..
-
-SUBDIRS = 
-MKLIB  = device_libs
-C_FILES = $(wildcard *.c)
-TARGETS = $(OBJS:.o=.lib)
-
-# allow invoking make without arguments (otherwise
-# [...]/devicelibs would be the default target)
-suball : all
-
-.PHONY : $(topsrcdir)/$(builddir)/device_libs suball
-
-$(topsrcdir)/$(builddir)/device_libs :
-       $(Q)+$(foreach dev,$(C_FILES:.c=),$(MAKE) $(topsrcdir)/$(builddir)/$(dev).lib LIB_O=$(topsrcdir)/$(builddir)/$(dev).o;)
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libdev/Makefile.in b/device/lib/pic16/libdev/Makefile.in
new file mode 100644 (file)
index 0000000..f3aa4ee
--- /dev/null
@@ -0,0 +1,38 @@
+###########################################################
+### Makefile for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+###    Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+###    Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
+
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+MKLIB  = device_libs
+C_FILES = $(notdir $(wildcard $(srcdir)/*.c))
+TARGETS = $(OBJS:.o=.lib)
+
+# allow invoking make without arguments (otherwise
+# [...]/devicelibs would be the default target)
+suball : all
+
+.PHONY : $(top_builddir)$(builddir)/device_libs suball
+
+$(top_builddir)$(builddir)/device_libs :
+       $(Q)+$(foreach dev,$(C_FILES:.c=),$(MAKE) $(top_builddir)$(builddir)/$(dev).lib LIB_O=$(top_builddir)$(builddir)/$(dev).o;)
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libio/Makefile b/device/lib/pic16/libio/Makefile
deleted file mode 100644 (file)
index ba199ba..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-###########################################################
-### Makefile for the GNU PIC Library
-###
-### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
-###
-### The GNU PIC Library was originally designed and
-### implemented by
-###    Vangelis Rokas <vrokas@otenet.gr>
-###
-### It is currently maintained by
-###    Raphael Neider <rneider@web.de>
-###
-### This file may be distributed under the terms of the the
-### GNU General Public License (GPL). See COPYING for details.
-###
-### $Id$
-###
-
-topsrcdir=..
-
-SUBDIRS = adc i2c usart
-
-ifeq ($(origin IO_ARCH),undefined)
-include $(topsrcdir)/Makefile.common
-
-.PHONY : all clean clean-intermediate install
-
-# I create $(builddir)/$${arch} right here in order to prevent 
-# the sub-make's `builddir´ rules from aborting if another sub-make
-# already created the above directory (happened on Alpha).
-all clean clean-intermediate install :
-       $(Q)+cat $(topsrcdir)/pics.build \
-               | $(SED) -e "s,[ \t]*#.*$$,," \
-               | $(GREP) -v "^[ \t]*$$" \
-               | while read arch; do \
-                       [ "x$${arch}" = "x" ] \
-                       || ( [ -d "$(builddir)/$${arch}" ] || $(MKDIR) "$(builddir)/$${arch}"; \
-                               $(MAKE) MKLIB=libio18f$${arch}.lib builddir=$(builddir)/$${arch} ARCH=$${arch} IO_ARCH=$${arch} $(MAKECMDGOALS); ) \
-                       || exit 1; \
-       done
-
-include $(topsrcdir)/Makefile.rules
-
-else
-
-include $(topsrcdir)/Makefile.subdir
-
-# prevent library to be build in $(SUBDIRS) as well
-unexport MKLIB
-
-endif
diff --git a/device/lib/pic16/libio/Makefile.in b/device/lib/pic16/libio/Makefile.in
new file mode 100644 (file)
index 0000000..1746f52
--- /dev/null
@@ -0,0 +1,54 @@
+###########################################################
+### Makefile for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+###    Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+###    Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
+
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = adc i2c usart
+
+ifeq ($(origin IO_ARCH),undefined)
+include $(top_builddir)Makefile.common
+
+.PHONY : all clean clean-intermediate install
+
+# I create $(builddir)/$${arch} right here in order to prevent 
+# the sub-make's `builddir´ rules from aborting if another sub-make
+# already created the above directory (happened on Alpha).
+all clean clean-intermediate install :
+       $(Q)+cat $(top_builddir)pics.build \
+               | $(SED) -e "s,[ \t]*#.*$$,," \
+               | $(GREP) -v "^[ \t]*$$" \
+               | while read arch; do \
+                       [ "x$${arch}" = "x" ] \
+                       || ( $(MKDIR) "$(top_builddir)$(builddir)/$${arch}"; \
+                               $(MAKE) MKLIB=libio18f$${arch}.lib builddir=$(builddir)/$${arch} ARCH=$${arch} IO_ARCH=$${arch} $(MAKECMDGOALS); ) \
+                       || exit 1; \
+       done
+
+include $(top_srcdir)/Makefile.rules
+
+else
+
+include $(top_srcdir)/Makefile.subdir
+
+# prevent library to be build in $(SUBDIRS) as well
+unexport MKLIB
+
+endif
diff --git a/device/lib/pic16/libio/adc/Makefile b/device/lib/pic16/libio/adc/Makefile
deleted file mode 100644 (file)
index 287b76f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS =
-TARGETS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libio/adc/Makefile.in b/device/lib/pic16/libio/adc/Makefile.in
new file mode 100644 (file)
index 0000000..624ecb3
--- /dev/null
@@ -0,0 +1,9 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS =
+TARGETS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libio/i2c/Makefile b/device/lib/pic16/libio/i2c/Makefile
deleted file mode 100644 (file)
index 26ecac5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS = 
-TARGETS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libio/i2c/Makefile.in b/device/lib/pic16/libio/i2c/Makefile.in
new file mode 100644 (file)
index 0000000..217d469
--- /dev/null
@@ -0,0 +1,9 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+TARGETS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libio/usart/Makefile b/device/lib/pic16/libio/usart/Makefile
deleted file mode 100644 (file)
index 287b76f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS =
-TARGETS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libio/usart/Makefile.in b/device/lib/pic16/libio/usart/Makefile.in
new file mode 100644 (file)
index 0000000..624ecb3
--- /dev/null
@@ -0,0 +1,9 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS =
+TARGETS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libm/Makefile b/device/lib/pic16/libm/Makefile
deleted file mode 100644 (file)
index da39ef7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=..
-
-SUBDIRS = 
-MKLIB = libm18f.lib
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libm/Makefile.in b/device/lib/pic16/libm/Makefile.in
new file mode 100644 (file)
index 0000000..8b7be6a
--- /dev/null
@@ -0,0 +1,9 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+MKLIB = libm18f.lib
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/Makefile b/device/lib/pic16/libsdcc/Makefile
deleted file mode 100644 (file)
index b43473e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-topsrcdir=..
-
-SUBDIRS = char fixed16x16 float gptr int long 
-       # lregs
-MKLIB = libsdcc.lib
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/Makefile.in b/device/lib/pic16/libsdcc/Makefile.in
new file mode 100644 (file)
index 0000000..2bf35eb
--- /dev/null
@@ -0,0 +1,10 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = char fixed16x16 float gptr int long 
+       # lregs
+MKLIB = libsdcc.lib
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/char/Makefile b/device/lib/pic16/libsdcc/char/Makefile
deleted file mode 100644 (file)
index 87adf7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/char/Makefile.in b/device/lib/pic16/libsdcc/char/Makefile.in
new file mode 100644 (file)
index 0000000..6bb1352
--- /dev/null
@@ -0,0 +1,8 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/fixed16x16/Makefile b/device/lib/pic16/libsdcc/fixed16x16/Makefile
deleted file mode 100644 (file)
index 87adf7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/fixed16x16/Makefile.in b/device/lib/pic16/libsdcc/fixed16x16/Makefile.in
new file mode 100644 (file)
index 0000000..6bb1352
--- /dev/null
@@ -0,0 +1,8 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/float/Makefile b/device/lib/pic16/libsdcc/float/Makefile
deleted file mode 100644 (file)
index 87adf7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/float/Makefile.in b/device/lib/pic16/libsdcc/float/Makefile.in
new file mode 100644 (file)
index 0000000..6bb1352
--- /dev/null
@@ -0,0 +1,8 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/gptr/Makefile b/device/lib/pic16/libsdcc/gptr/Makefile
deleted file mode 100644 (file)
index 87adf7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/gptr/Makefile.in b/device/lib/pic16/libsdcc/gptr/Makefile.in
new file mode 100644 (file)
index 0000000..6bb1352
--- /dev/null
@@ -0,0 +1,8 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/int/Makefile b/device/lib/pic16/libsdcc/int/Makefile
deleted file mode 100644 (file)
index 87adf7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/int/Makefile.in b/device/lib/pic16/libsdcc/int/Makefile.in
new file mode 100644 (file)
index 0000000..6bb1352
--- /dev/null
@@ -0,0 +1,8 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/long/Makefile b/device/lib/pic16/libsdcc/long/Makefile
deleted file mode 100644 (file)
index 87adf7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/long/Makefile.in b/device/lib/pic16/libsdcc/long/Makefile.in
new file mode 100644 (file)
index 0000000..6bb1352
--- /dev/null
@@ -0,0 +1,8 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/lregs/Makefile b/device/lib/pic16/libsdcc/lregs/Makefile
deleted file mode 100644 (file)
index 87adf7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-topsrcdir=../..
-
-SUBDIRS = 
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/libsdcc/lregs/Makefile.in b/device/lib/pic16/libsdcc/lregs/Makefile.in
new file mode 100644 (file)
index 0000000..6bb1352
--- /dev/null
@@ -0,0 +1,8 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/pic16/startup/Makefile b/device/lib/pic16/startup/Makefile
deleted file mode 100644 (file)
index 882981f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-topsrcdir=..
-
-SUBDIRS = 
-TARGETS = $(OBJS)
-
-include $(topsrcdir)/Makefile.subdir
diff --git a/device/lib/pic16/startup/Makefile.in b/device/lib/pic16/startup/Makefile.in
new file mode 100644 (file)
index 0000000..f07a713
--- /dev/null
@@ -0,0 +1,9 @@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+srcdir       = @srcdir@
+VPATH        = @srcdir@
+
+SUBDIRS = 
+TARGETS = $(OBJS)
+
+include $(top_srcdir)/Makefile.subdir
diff --git a/device/lib/small/Makefile b/device/lib/small/Makefile
deleted file mode 100644 (file)
index b576379..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# Dummy Makefile to get around Subversion
-all:
-       $(MAKE) -C ../mcs51 all
-       cp ../mcs51/*.rel ../mcs51/*.lib .
-       touch dummy.lib
-       touch dummy.rel
-
-clean:
-       rm *.rel *.lib
diff --git a/device/lib/small/Makefile.in b/device/lib/small/Makefile.in
new file mode 100644 (file)
index 0000000..4acca3f
--- /dev/null
@@ -0,0 +1,11 @@
+all:
+       $(MAKE) -C ../mcs51 all
+       cp ../mcs51/*.rel ../mcs51/*.lib .
+       touch dummy.lib
+       touch dummy.rel
+
+clean:
+       rm -f *.rel *.lib
+
+distclean: clean
+       rm -f Makefile
\ No newline at end of file
diff --git a/device/lib/z80/Makefile b/device/lib/z80/Makefile
deleted file mode 100644 (file)
index fad51ae..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# libc/z80 Makefile
-
-TOPDIR = ../../..
-
-SCC = $(TOPDIR)/bin/sdcc -mz80
-SAS = $(TOPDIR)/bin/as-z80
-
-OBJ = div.o mul.o putchar.o shift.o stubs.o crt0_rle.o heap.o fstubs.o
-
-LIB = z80.lib
-CC = $(SCC)
-AS = $(SAS)
-ASFLAGS = -plosgff
-
-CFLAGS = -I../../include -I.
-
-all: $(LIB) crt0.o
-
-$(LIB): $(OBJ) Makefile _dummy
-       rm -f $(LIB)
-       for i in $(OBJ); do echo $$i >> $(LIB); done
-
-.c.o:
-       $(CC) $(CFLAGS) -c $<
-
-.s.o:
-       $(AS) $(ASFLAGS) $@ $<
-
-_dummy:
-
-clean:
-       rm -f *.o *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib
diff --git a/device/lib/z80/Makefile.in b/device/lib/z80/Makefile.in
new file mode 100644 (file)
index 0000000..fe7304a
--- /dev/null
@@ -0,0 +1,38 @@
+# libc/z80 Makefile
+
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+TOPDIR = ../../..
+
+SCC = $(TOPDIR)/bin/sdcc -mz80
+SAS = $(TOPDIR)/bin/as-z80
+
+OBJ = div.o mul.o putchar.o shift.o stubs.o crt0_rle.o heap.o fstubs.o
+
+LIB = z80.lib
+CC = $(SCC)
+AS = $(SAS)
+ASFLAGS = -plosgff
+
+CFLAGS = -I../../include -I.
+
+all: $(LIB) crt0.o
+
+$(LIB): $(OBJ) Makefile _dummy
+       rm -f $(LIB)
+       for i in $(OBJ); do echo $$i >> $(LIB); done
+
+.c.o:
+       $(CC) $(CFLAGS) -c $<
+
+.s.o:
+       $(AS) $(ASFLAGS) $@ $<
+
+_dummy:
+
+clean:
+       rm -f *.o *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib
+
+distclean: clean
+       rm -f Makefile
\ No newline at end of file
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644 (file)
index 05c1976..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-include ../Makefile.common
-
-ifdef $(LYX_SYSDIR)
-  LYXFLAGS += -sysdir $(LYX_SYSDIR)
-endif
-
-MANUAL = sdccman
-TSS = test_suite_spec
-CDB = cdbfileformat
-
-SOURCES = $(MANUAL).lyx $(TSS).lyx $(CDB).lyx
-
-TXT  = $(SOURCES:.lyx=.txt)
-PDF  = $(SOURCES:.lyx=.pdf)
-TEX  = $(SOURCES:.lyx=.tex)
-HTML_DIR   = $(SOURCES:.lyx=.html)
-HTML_INDEX = $(SOURCES:.lyx=.html/index.html)
-
-all: $(TXT) $(PDF) $(HTML_INDEX)
-
-install:
-       $(INSTALL) -d $(DESTDIR)$(docdir)
-       cp -rf *.txt z80 avr $(DESTDIR)$(docdir)
-       if [ -f $(MANUAL).html/index.html ]; then cp -rf $(MANUAL).html $(DESTDIR)$(docdir); fi
-       if [ -f $(TSS).html/index.html    ]; then cp -rf $(TSS).html    $(DESTDIR)$(docdir); fi
-       if [ -f $(CDB).html/index.html    ]; then cp -rf $(CDB).html    $(DESTDIR)$(docdir); fi
-       if [ -f $(MANUAL).pdf             ]; then cp -rf $(MANUAL).pdf  $(DESTDIR)$(docdir); fi
-       if [ -f $(TSS).pdf                ]; then cp -rf $(TSS).pdf     $(DESTDIR)$(docdir); fi
-       if [ -f $(CDB).pdf                ]; then cp -rf $(CDB).pdf     $(DESTDIR)$(docdir); fi
-       rm -rf `find $(DESTDIR)$(docdir) -name .svn -type d`
-       rm -f $(DESTDIR)$(docdir)/*/WARNINGS $(DESTDIR)$(docdir)/*/*.pl $(DESTDIR)$(docdir)/*/images.*
-
-uninstall:
-       rm -rf $(DESTDIR)$(docdir)
-
-$(MANUAL).html/index.html: $(MANUAL).tex $(MANUAL).ind
-       rm -rf $(MANUAL).html 
-       mkdir -p `dirname $@`
-       # fixes latex2html problems with two consecutive dashes for long-options: --stack-auto
-       # fixes latex2html problems with \tabularnewline
-       mv $< `basename $< .tex`.orig.tex
-       sed 's,-\\/-,-\\/-\\/-,g' < `basename $< .tex`.orig.tex | \
-       sed 's,\\tabularnewline$$,\\\\,g' > $<
-       -latex2html -show_section_numbers -split 5 -local_icons -dir $(MANUAL).html `basename $<`
-       mv `basename $< .tex`.orig.tex $<
-       rm -f $(MANUAL).html/WARNINGS $(MANUAL).html/labels.pl
-
-$(TSS).html/index.html: $(TSS).tex
-       rm -rf `dirname $@`
-       mkdir -p `dirname $@`
-       # fixes latex2html problems with two consecutive dashes for long-options: --stack-auto
-       # fixes latex2html problems with \tabularnewline
-       mv $< `basename $< .tex`.orig.tex
-       sed 's,-\\/-,-\\/-\\/-,g' < `basename $< .tex`.orig.tex | \
-       sed 's,\\tabularnewline$$,\\\\,g' > $<
-       -latex2html -split 0 -local_icons -dir $(TSS).html `basename $<`
-       mv `basename $< .tex`.orig.tex $<
-       rm -f $(TSS).html/WARNINGS $(TSS).html/labels.pl
-
-$(CDB).html/index.html: $(CDB).tex
-       rm -rf `dirname $@`
-       mkdir -p `dirname $@`
-       # fixes latex2html problems with two consecutive dashes for long-options: --stack-auto
-       # fixes latex2html problems with \tabularnewline
-       mv $< `basename $< .tex`.orig.tex
-       sed 's,-\\/-,-\\/-\\/-,g' < `basename $< .tex`.orig.tex | \
-       sed 's,\\tabularnewline$$,\\\\,g' > $<
-       -latex2html -show_section_numbers -split 0 -local_icons -dir $(CDB).html `basename $<`
-       mv `basename $< .tex`.orig.tex $<
-       rm -f $(CDB).html/WARNINGS $(CDB).html/labels.pl
-
-%.txt: %.lyx
-       lyx -e text $(LYXFLAGS) $<
-
-%.pdf: %.tex
-       @echo "### Create pdf from tex: $< -> $@"
-       pdflatex $*
-       -makeindex $*
-       pdflatex $*
-       pdflatex $*
-       pdfopt $*.pdf tmp.pdf
-       rm $*.pdf
-       mv tmp.pdf $*.pdf
-
-#%.ps:  %.pdf
-#      dvips $*
-
-%.dvi: %.tex
-       latex $<
-
-%.tex: %.lyx
-       lyx -e latex $< $(LYXFLAGS)
-
-#%.ind: %.dvi
-#      latex $*
-#      -makeindex $*
-##     -makeindex -s l2hidx.ist $*
-       #latex $*
-#      latex $*
-
-#%.glo: %.dvi
-#      # the glossary, not implemented yet
-#      # makeindex -s l2hglo.ist -o $@ $<
-
-archive: all
-       rm -rf sdcc-doc sdcc-doc.tar.bz2
-       mkdir sdcc-doc
-       rsync -rCt avr z80 *.pdf *.txt sdcc-doc
-
-       for doc in $(MANUAL) $(TSS) $(CDB); do \
-         rsync -Rt $$doc.html/*.html $$doc.html/*.png $$doc.html/*.css sdcc-doc/; \
-       done
-
-       mkdir sdcc-doc/as
-       rsync -rCt ../as/doc/* sdcc-doc/as/
-
-       mkdir sdcc-doc/ucsim
-       cd ../sim/ucsim/doc; rsync *.html *.jpg *.gif *.fig ../../../doc/sdcc-doc/ucsim/
-
-       tar -c sdcc-doc | bzip2 -9 > sdcc-doc.tar.bz2
-
-include clean.mk
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644 (file)
index 0000000..1b15441
--- /dev/null
@@ -0,0 +1,135 @@
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+LYX        = @LYX@
+LATEX      = @LATEX@
+LATEX2HTML = @LATEX2HTML@
+PDFLATEX   = @PDFLATEX@
+DVIPDF     = @DVIPDF@
+DVIPS      = @DVIPS@
+MAKEINDEX  = @MAKEINDEX@
+
+include ../Makefile.common
+
+MANUAL = sdccman
+TSS = test_suite_spec
+CDB = cdbfileformat
+
+all: $(MANUAL).pdf $(MANUAL).html/index.html $(MANUAL).txt \
+       $(TSS).pdf $(TSS).html/index.html $(TSS).txt \
+       $(CDB).pdf $(CDB).html/index.html $(CDB).txt
+
+install:
+       $(INSTALL) -d $(DESTDIR)$(docdir)
+       cp -rf $(srcdir)/*.txt $(srcdir)/z80 $(srcdir)/avr $(DESTDIR)$(docdir)
+       cp -rf *.txt $(DESTDIR)$(docdir)
+       if [ -f $(MANUAL).html/index.html ]; then cp -rf $(MANUAL).html $(DESTDIR)$(docdir); fi
+       if [ -f $(TSS).html/index.html    ]; then cp -rf $(TSS).html    $(DESTDIR)$(docdir); fi
+       if [ -f $(CDB).html/index.html    ]; then cp -rf $(CDB).html    $(DESTDIR)$(docdir); fi
+       if [ -f $(MANUAL).pdf             ]; then cp -rf $(MANUAL).pdf  $(DESTDIR)$(docdir); fi
+       if [ -f $(TSS).pdf                ]; then cp -rf $(TSS).pdf     $(DESTDIR)$(docdir); fi
+       if [ -f $(CDB).pdf                ]; then cp -rf $(CDB).pdf     $(DESTDIR)$(docdir); fi
+       rm -rf `find $(DESTDIR)$(docdir) -name .svn -type d`
+       rm -f $(DESTDIR)$(docdir)/*/WARNINGS $(DESTDIR)$(docdir)/*/*.pl $(DESTDIR)$(docdir)/*/images.*
+
+uninstall:
+       rm -rf $(DESTDIR)$(docdir)
+
+$(MANUAL).html/index.html: $(MANUAL).tex $(MANUAL).ind ;#$(MANUAL).glo
+       mkdir -p $(dir $@)
+       @# fixes $(LATEX2HTML) problems with two consecutive dashes for long-options: --stack-auto
+       @# fixes $(LATEX2HTML) problems with \tabularnewline
+       mv $< $(basename $<).orig.tex
+       sed -e 's,-\\/-,-\\/-\\/-,g' \
+           -e 's,\\tabularnewline$$,\\\\,g' < $(basename $<).orig.tex > $<
+       touch $< -r $(basename $<).orig.tex # avoid warning that *.tex is newer than *.aux
+       -$(LATEX2HTML) -split 5 -show_section_numbers -local_icons -info "" -dir $(MANUAL).html $(MANUAL)
+       mv $(basename $<).orig.tex $<
+
+$(TSS).html/index.html: $(TSS).tex
+       mkdir -p $(dir $@)
+       @# fixes $(LATEX2HTML) problems with two consecutive dashes for long-options: --stack-auto
+       @# fixes $(LATEX2HTML) problems with \tabularnewline
+       mv $< $(basename $<).orig.tex
+       sed -e 's,-\\/-,-\\/-\\/-,g' \
+           -e 's,\\tabularnewline$$,\\\\,g' < $(basename $<).orig.tex > $<
+       touch $< -r $(basename $<).orig.tex # avoid warning that *.tex is newer than *.aux
+       -$(LATEX2HTML) -split 0 -local_icons -info "" -dir $(TSS).html $(TSS)
+       mv $(basename $<).orig.tex $<
+
+$(CDB).html/index.html: $(CDB).tex
+       mkdir -p $(dir $@)
+       @# fixes $(LATEX2HTML) problems with two consecutive dashes for long-options: --stack-auto
+       @# fixes $(LATEX2HTML) problems with \tabularnewline
+       mv $< $(basename $<).orig.tex
+       sed -e 's,-\\/-,-\\/-\\/-,g' \
+           -e 's,\\tabularnewline$$,\\\\,g' < $(basename $<).orig.tex > $<
+       touch $< -r $(basename $<).orig.tex # avoid warning that *.tex is newer than *.aux
+       -$(LATEX2HTML) -split 0 -show_section_numbers -local_icons -info "" -dir $(CDB).html $(CDB)
+       mv $(basename $<).orig.tex $<
+
+%.txt: %.lyx
+       @# $(LYX) will export the file in the directory of the $(LYX) file
+       @# if VPATH is used the $(LYX) file is copied first
+       if [ "$(srcdir)" != "." ]; then \
+         cp $< . ; \
+         $(LYX) -e text $(notdir $<) ; \
+         rm $(notdir $<) ; \
+       else \
+         $(LYX) -e text $< ; \
+       fi
+
+%.pdf: %.tex %.dvi %.ind
+       $(DVIPDF) $*
+# pdflatex creates documents for acrobat reader >= 5.0 
+#      which $(PDFLATEX) > /dev/null && $(PDFLATEX) $* || $(DVIPDF) $*
+
+%.ps:  %.pdf
+       $(DVIPS) $*
+
+%.dvi: %.tex
+       $(LATEX) $<
+       @# rerun to in include aux
+       $(LATEX) $<
+
+%.tex: %.lyx
+       if [ "$(srcdir)" != "." ] ; then \
+         cp $< . ; \
+         $(LYX) -e latex $(notdir $<) ; \
+         rm $(notdir $<) ; \
+       else \
+         $(LYX) -e latex $< ; \
+       fi
+
+%.ind: %.dvi
+       $(LATEX) $*
+       # is there an index?
+       if [ -f $*.idx ] ; then \
+         $(MAKEINDEX) $*; \
+         $(LATEX) $*; \
+         $(LATEX) $*; \
+       fi
+#        -$(MAKEINDEX) -s l2hidx.ist $*; \
+
+%.glo: %.dvi
+       # the glossary, not implemented yet
+       # $(MAKEINDEX) -s l2hglo.ist -o $@ $<
+
+archive: all
+       rm -rf sdcc-doc sdcc-doc.tar.bz2
+       mkdir sdcc-doc
+       rsync -rCt avr z80 *.pdf *.txt $(srcdir)/*.txt sdcc-doc
+
+       for doc in $(MANUAL) $(TSS) $(CDB); do \
+         rsync -Rt $$doc.html/*.html $$doc.html/*.png $$doc.html/*.css sdcc-doc/; \
+       done
+
+       mkdir sdcc-doc/as
+       rsync -rCt $(top_srcdir)/as/doc/* sdcc-doc/as/
+
+       mkdir sdcc-doc/ucsim
+       cd $(top_srcdir)/sim/ucsim/doc; rsync *.html *.jpg *.gif *.fig ../../../doc/sdcc-doc/ucsim/
+
+       tar -c sdcc-doc | bzip2 -9 > sdcc-doc.tar.bz2
+
+include $(srcdir)/clean.mk
index 469bc7a36e008c18e38fab1fd98ae56092249ed9..add9f7fa235a7f29f1171cd25e7dad8d0751fb69 100644 (file)
@@ -1,7 +1,5 @@
 clean:
-# The directories are still in Subversion, so don't delete them
-#       rm -rf $(MANUAL).html $(TSS).html
-       rm -rf $(MANUAL).html/* $(TSS).html/* $(CDB).html
+       rm -rf $(MANUAL).html $(TSS).html $(CDB).html
        rm -rf $(MANUAL).txt $(TSS).txt $(CDB).txt \
                *.pdf *.tex *.aux *.dvi *.idx *.ilg *.out\
                *.ind *.log *.toc *~ \#* *.ps */*.css */*.pl *.gif core *.glo
@@ -10,6 +8,7 @@ clean:
 # Deleting all files created by configuring or building the program
 # -----------------------------------------------------------------
 distclean: clean
+       rm -f Makefile
 
 # Like clean but some files may still exist
 # -----------------------------------------
index e66d11e7500cd06150319150e82f32cb66e6802b..353506e9a88539c31e6b2bce8f47ec01e0e1d9e6 100644 (file)
@@ -840,7 +840,7 @@ status Collapsed
 /
 \end_inset 
 
--disable-device-lib-build Disables automatically building device libraries
+-disable-device-lib Disables automatically building device libraries
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -868,6 +868,20 @@ status Collapsed
 /
 \end_inset 
 
+-enable-doc Build pdf, html and txt files from the lyx sources
+\layout List
+\labelwidthstring 00.00.0000
+
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
 -enable-libgc Use the Bohem memory allocator.
  Lower runtime footprint.
 \layout Standard
@@ -1571,7 +1585,7 @@ status Collapsed
 /
 \end_inset 
 
--disable-device-lib-build
+-disable-device-lib
 \backslash 
 
 \newline 
@@ -3554,13 +3568,137 @@ sdcc_yyyymmdd_setup.exe
 
  and execute it.
  A windows typical installer will guide you through the installation process.
+\layout Subsection
+
+VPATH
+\begin_inset LatexCommand \index{VPATH}
+
+\end_inset 
+
+ feature
+\layout Standard
+
+SDCC supports the VPATH feature provided by configure and make.
+ It allows to separate the source and build trees.
+ Here's an example:
+\layout Standard
+
+
+\family typewriter 
+cd ~\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+# cd $HOME
+\layout Standard
+
+
+\family typewriter 
+tar -xzf sdcc.src.tar.gz\SpecialChar ~
+# extract source to directory sdcc
+\layout Standard
+
+
+\family typewriter 
+mkdir sdcc.build\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+# put output in sdcc.build
+\layout Standard
+
+
+\family typewriter 
+cd sdcc.build
+\layout Standard
+
+
+\family typewriter 
+../sdcc/configure\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+# configure is doing all the magic!
+\layout Standard
+
+
+\family typewriter 
+make
+\layout Standard
+\noindent 
+That's it! 
+\series bold 
+configure
+\series default 
+ will create the directory tree will all the necessary Makefiles in ~/sdcc.build.
+ It automagically computes the variables srcdir, top_srcdir and top_buildir
+ for each directory.
+ After running 
+\series bold 
+make
+\series default 
+ the generated files will be in ~/sdcc.build, while the source files stay
+ in ~/sdcc.
+\newline 
+This is not only usefull for building different binaries, e.g.
+ when cross compiling.
+ It also gives you a much better overview in the source tree when all the
+ generated files are not scattered between the source files.
+ And the best thing is: if you want to change a file you can leave the original
+ file untouched in the source directory.
+ Simply copy it to the build directory, edit it, enter `make clean`, `rm
+ Makefile.dep` and `make`.
+\series bold 
+make
+\series default 
+ will do the rest for you!
 \layout Section
 
 Building the Documentation
 \layout Standard
 
-If the necessary tools (LyX, LaTeX, LaTeX2HTML) are installed it is as easy
- as changing into the doc directory and typing 
+Add -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-enable-doc to the configure arguments to build the documentation together
+ with all the other stuff.
+ You will need several tools (LyX, LaTeX, LaTeX2HTML, pdflatex, dvipdf,
+ dvips and makeindex) to get the job done.
+ Another possibility is to change to the doc directory and to type 
 \family sans 
 \series bold 
 
@@ -3582,7 +3720,7 @@ x).
 
 \end_inset 
 
- as editor this is straightforward.
+ as editor is straightforward.
  Prebuilt documentation in html and pdf format is available from 
 \begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
 
diff --git a/link/Makefile b/link/Makefile
deleted file mode 100644 (file)
index 3197967..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-PRJDIR = ..
-
-include $(PRJDIR)/Makefile.common
-
-PORTS = z80 gbz80
-
-all: 
-       $(MAKE) -C z80 _link-z80 _link-gbz80 E=$(E) BUILDDIR=../../bin/
-
-install: all
-       $(INSTALL) $(PRJDIR)/bin/link-z80$(EXEEXT) `echo $(DESTDIR)$(bindir)/link-z80$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(DESTDIR)$(bindir)/link-z80$(EXEEXT)|sed '$(transform)'`
-       $(INSTALL) $(PRJDIR)/bin/link-gbz80$(EXEEXT) `echo $(DESTDIR)$(bindir)/link-gbz80$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(DESTDIR)$(bindir)/link-gbz80$(EXEEXT)|sed '$(transform)'`
-
-uninstall:
-       cd $(DESTDIR)$(bindir); rm -f link-z80$(EXEEXT) link-gbz80$(EXEEXT)
-
-include clean.mk
diff --git a/link/Makefile.in b/link/Makefile.in
new file mode 100644 (file)
index 0000000..54cf61a
--- /dev/null
@@ -0,0 +1,21 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+
+include $(top_builddir)Makefile.common
+
+PORTS = z80 gbz80
+
+all: 
+       $(MAKE) -C z80 _link-z80 _link-gbz80 E=$(E) BUILDDIR=../../bin/
+
+install: all
+       $(INSTALL) $(top_builddir)bin/link-z80$(EXEEXT) `echo $(DESTDIR)$(bindir)/link-z80$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/link-z80$(EXEEXT)|sed '$(transform)'`
+       $(INSTALL) $(top_builddir)bin/link-gbz80$(EXEEXT) `echo $(DESTDIR)$(bindir)/link-gbz80$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/link-gbz80$(EXEEXT)|sed '$(transform)'`
+
+uninstall:
+       cd $(DESTDIR)$(bindir); rm -f link-z80$(EXEEXT) link-gbz80$(EXEEXT)
+
+include $(srcdir)/clean.mk
index 27351ebfbf999fd3a15e72a95d3462d84bf77079..e843581790631c806635a50930e0e85e2a560afc 100644 (file)
@@ -1,4 +1,6 @@
 clean:
-       $(MAKE) -C z80 -f clean.mk clean
+       $(MAKE) -C z80 clean
 
 distclean: clean
+       $(MAKE) -C z80 distclean
+       rm -f Makefile
index e51841862da8bd04ebdbcd4aa9a4166ecc8585df..1f67a7f77b35f7ff8a6353db539b914304b2f7a8 100644 (file)
-#
-#
-#
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
 
-VERSION         = @VERSION@
-VERSIONHI       = @VERSIONHI@
-VERSIONLO       = @VERSIONLO@
-VERSIONP        = @VERSIONP@
+include $(top_builddir)Makefile.common
 
-SHELL          = /bin/sh
-CC             = @CC@
-CPP            = @CPP@
-INSTALL                = @INSTALL@
+OBJDIR = obj/$(EXT)
 
-PRJDIR         = ../..
+SLIBSRC        = NewAlloc.c
 
-EXEEXT          = @EXEEXT@
+SRC    = lkarea.c lkdata.c lkeval.c lkhead.c lkihx.c lklex.c \
+         lklibr.c lklist.c lkmain.c lkrloc.c lks19.c lksym.c \
+         lkgb.c lkgg.c
 
-srcdir         = @srcdir@
-prefix         = @prefix@
-exec_prefix     = @exec_prefix@
-bindir          = @bindir@
-libdir          = @libdir@
-datadir         = @datadir@
-includedir      = @includedir@
-mandir          = @mandir@
-man1dir         = $(mandir)/man1
-man2dir         = $(mandir)/man2
-infodir         = @infodir@
+OBJS   = $(SRC:%.c=$(OBJDIR)/%.o) 
+SLIBOBJS       = $(SLIBSRC:%.c=$(OBJDIR)/%.o) 
 
-SLIB   =$(PRJDIR)/support/Util
+BINS   = $(BUILDDIR)link$(EXT)$(EXEEXT)
 
-CPPFLAGS       = @CPPFLAGS@ -I. -I$(PRJDIR) -I$(PRJDIR)/as/z80 -I$(SLIB)
-CFLAGS         = @CFLAGS@ -Wall -DINDEXLIB -DMLH_MAP -DUNIX -DSDK -DSDK_VERSION_STRING="\"3.0.0\"" -DTARGET_STRING="\"gbz80\"" -funsigned-char
-M_OR_MM                = @M_OR_MM@
-LDFLAGS                = @LDFLAGS@ -lm
+CFLAGS += $(CPPFLAGS) $(OPTS) -DINDEXLIB -DMLH_MAP -DUNIX -DSDK
+CFLAGS += -funsigned-char -DUNIX
+CFLAGS += -I$(top_builddir)as/$(PORT) -I$(SLIB) 
 
-SLIBOBJS       = NewAlloc.o
+LDFLAGS += -lm $(EXTRALIBS)
 
-LKOBJECTS      = lkarea.o lkdata.o lkeval.o lkhead.o lkihx.o lklex.o \
-                 lklibr.o lklist.o lkmain.o lkrloc.o lks19.o lksym.o \
-                 lkgb.o lkgg.o 
-LKSOURCES      = $(patsubst %.o,%.c,$(LKOBJECTS))
+all:   $(BINS)
 
-LKZ80          = $(PRJDIR)/bin/link-z80$(EXEEXT)
+$(BINS): $(OBJDIR) $(OBJS) $(SLIBOBJS)
+       $(CC) -g -o $(BINS) $(OBJS) $(SLIBOBJS) $(LDFLAGS)
 
-# Compiling entire program or any subproject
-# ------------------------------------------
-all: checkconf $(LKZ80)
+$(OBJDIR):
+       mkdir -p $(OBJDIR)
 
-$(LKZ80): $(SLIBOBJS) $(LKOBJECTS)
-       $(CC) $(CFLAGS) -o $@ $(SLIBOBJS) $(LKOBJECTS) $(LDFLAGS)
+$(OBJDIR)/%.o: %.c
+       $(CC) -c $(CFLAGS) -o $@ $<
 
-# Compiling and installing everything and runing test
-# ---------------------------------------------------
-install: all installdirs
-       $(INSTALL) $(LKZ80) $(DESTDIR)$(bindir)/link-z80$(EXEEXT)
+$(OBJDIR)/%.o: $(SLIB)/%.c
+       $(CC) -c $(CFLAGS) -o $@ $<
 
-# Deleting all the installed files
-# --------------------------------
-uninstall:
-       rm -f $(DESTDIR)$(bindir)/link-z80$(EXEEXT)
+_link-z80:
+       $(MAKE) EXT=-z80$(E) PORT=z80
 
+_link-gbz80:
+       $(MAKE) EXT=-gbz80$(E) OPTS=-DGAMEBOY PORT=z80
 
-# Performing self-test
-# --------------------
-check:
-
-
-# Performing installation test
-# ----------------------------
-installcheck:
-
-
-# Creating installation directories
-# ---------------------------------
-installdirs:
-       $(INSTALL) -d $(DESTDIR)$(bindir)
-
-
-# Creating dependencies
-# ---------------------
-dep: Makefile.dep
-
-Makefile.dep: $(LKSOURCES) *.h $(PRJDIR)/*.h
-       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(LKSOURCES) >Makefile.dep
-
-include Makefile.dep
-include clean.mk
-
-# My rules
-# --------
-.c.o:
-       $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
-
-$(SLIBOBJS):%.o:$(SLIB)/%.c
-       $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-
-# Remaking configuration
-# ----------------------
-checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-          $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
-        fi
-
-# End of Makefile
+include $(srcdir)/clean.mk
index 9874fc3f5e654e212eff2073b9a77c55633d2192..4e13a896a9ddee01b09e7fad29171eea32df0158 100644 (file)
@@ -1,20 +1,19 @@
 # Deleting all files created by building the program
 # --------------------------------------------------
-PRJDIR = ../..
-include $(PRJDIR)/Makefile.common
+include $(top_builddir)Makefile.common
 
 clean:
        rm -f *core *[%~] *.[oa]
        rm -f .[a-z]*~
-       rm -f $(PRJDIR)/bin/link-z80$(EXEEXT) link-z80$(EXEEXT) \
-             $(PRJDIR)/bin/link-gbz80$(EXEEXT) link-gbz80$(EXEEXT)
+       rm -f $(top_builddir)bin/link-z80$(EXEEXT) link-z80$(EXEEXT) \
+             $(top_builddir)bin/link-gbz80$(EXEEXT) link-gbz80$(EXEEXT)
        rm -f *.dep
        rm -rf obj
 
 # Deleting all files created by configuring or building the program
 # -----------------------------------------------------------------
 distclean: clean
-
+       rm -f Makefile
 
 # Like clean but some files may still exist
 # -----------------------------------------
index 1ce49560f6a8049b6e4abe6e71c8454401c2c390..3fa379d41a26668c9304f256f10c5c4d5d4f2ea8 100644 (file)
@@ -3,7 +3,7 @@
 clean:
        rm -f *core *[%~] *.[oa]
        rm -f .[a-z]*~
-       rm -f $(PRJDIR)/link-z80 link-z80 
+       rm -f $(top_builddir)bin/link-z80 link-z80
 
 
 # Deleting all files created by configuring or building the program
index 2ade72f41965b23b81726602debc0fdeab89d73b..86a5f107854c21815520cc1603e7e0568cb05d23 100644 (file)
@@ -76,7 +76,7 @@ dep: #main.dep
 #      $(CPP) $(CPPFLAGS) $(M_OR_MM) *.c >main.dep
 
 #include main.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
index a0a15e24781837bce81c3c9b79b685dd3e869b2f..137a7d634211de8ad30d1e74fe56f3d8331bcb7a 100644 (file)
@@ -1,6 +1,9 @@
 PRJDIR          = ..
+VPATH           = @srcdir@
+srcdir          = @srcdir@
+top_builddir    = @top_builddir@
 
-include $(PRJDIR)/Makefile.common
+include $(PRJDIR)/$(top_builddir)Makefile.common
 
 CFLAGS          += -Wall
 
@@ -8,7 +11,7 @@ OBJECTS        = packihx.o
 
 SOURCES                = $(patsubst %.o,%.c,$(OBJECTS))
 
-TARGET         = $(PRJDIR)/bin/packihx$(EXEEXT)
+TARGET         = $(PRJDIR)/$(top_builddir)bin/packihx$(EXEEXT)
 
 all: $(TARGET)
 
@@ -50,4 +53,4 @@ $(TARGET): $(OBJECTS)
 
 checkconf:
 
-include clean.mk
+include $(srcdir)/clean.mk
index 734faae5a11e37bfee2665a36599479c6959260d..d0469ea5adae6ccdd319f6a285e714111ecf3848 100644 (file)
@@ -1,9 +1,7 @@
-PRJDIR = ..
-
 clean:
        rm -f *core *[%~] *.[oa] *.output
        rm -f .[a-z]*~ \#*
-       rm -f $(PRJDIR)/bin/packihx$(EXEEXT)
+       rm -f $(top_builddir)bin/packihx$(EXEEXT)
 
 distclean realclean: clean
        rm -f config.* Makefile
diff --git a/sim/ucsim/Makefile b/sim/ucsim/Makefile
deleted file mode 100644 (file)
index f5854aa..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-#
-# uCsim Makefile
-#
-# (c) Drotos Daniel, Talker Bt. 1997,99
-#
-
-STARTYEAR      = 1997
-
-SHELL          = /bin/sh
-
-PRJDIR         = .
-include packages.mk
-#PKGS          = cmd.src sim.src gui.src s51.src avr.src z80.src doc
-
-srcdir          = .
-
-
-# Compiling entire program or any subproject
-# ------------------------------------------
-all: checkconf
-       $(MAKE) -f main.mk all
-       @for pkg in $(PKGS); do\
-         cd $$pkg && $(MAKE) $$pkg ; cd ..;\
-       done
-       $(MAKE) -f main.mk main_app
-
-libs: main.mk
-       $(MAKE) -f main.mk libs
-
-
-# Compiling and installing everything and runing test
-# ---------------------------------------------------
-.PHONY: install INSTALL Install
-install:
-       $(MAKE) -f main.mk install
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg install ;\
-       done
-
-
-# Deleting all the installed files
-# --------------------------------
-uninstall:
-       $(MAKE) -f main.mk uninstall
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg uninstall ;\
-       done
-
-
-# Deleting all files created by building the program
-# --------------------------------------------------
-clean:
-       $(MAKE) -f clean.mk clean EXEEXT=$(EXEEXT)
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg -f clean.mk clean EXEEXT=$(EXEEXT) ;\
-       done
-
-
-# Deleting all files created by configuring or building the program
-# -----------------------------------------------------------------
-distclean: clean
-       $(MAKE) -f clean.mk distclean
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg -f clean.mk distclean ;\
-       done
-       rm -rf doc/*~ doc/*.bak
-
-
-# Like clean but some files may still exist
-# -----------------------------------------
-mostlyclean: clean
-       $(MAKE) -f clean.mk mostlyclean
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg -f clean.mk mostlyclean ;\
-       done
-
-
-# Deleting everything that can reconstructed by this Makefile. It deletes
-# everything deleted by distclean plus files created by bison, stc.
-# -----------------------------------------------------------------------
-realclean: distclean
-       $(MAKE) -f clean.mk realclean
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg -f clean.mk realclean ;\
-       done
-
-
-# Creating distribution
-# ---------------------
-dist: distclean
-       @if [ -f devel ]; then\
-         rm -f devel; mkdist; touch devel;\
-       else\
-         mkdist;\
-       fi
-
-
-# Performing self-test
-# --------------------
-check:
-       $(MAKE) -f main.mk check
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg check ;\
-       done
-
-test:
-       $(MAKE) -f main.mk test
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg test ;\
-       done
-
-
-# Performing installation test
-# ----------------------------
-installcheck:
-
-
-# Creating dependencies
-# ---------------------
-dep:
-       $(MAKE) -f main.mk dep
-       @for pkg in $(PKGS); do\
-         $(MAKE) -C $$pkg dep ;\
-       done
-
-
-# My rules
-# --------
-putcopyright:
-       'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
-
-start:
-       date '+%Y.%m.%d-%H:%M' >.start
-
-newer: distclean
-       @if [ -f .start ]; then \
-         tar cvf - \
-           `find . -newer .start -type f -print` |\
-         gzip -9c >ucsim-newer-`cat .start`_`date '+%Y.%m.%d-%H:%M'`_`hostname`.tgz; \
-       else \
-         echo ".start file not found.\n"; \
-         exit 1; \
-       fi
-
-print-newer:
-       @if [ -f .start ]; then \
-         find . -newer .start -type f -print ;\
-       else \
-         echo ".start file not found.\n" ;\
-         exit 1 ;\
-       fi
-
-new_files:
-       diff -rNu $$HOME/clean-source/sdcc/sim/ucsim .|\
-       grep '^diff' | grep -v "\.svn" | awk '{print $$4}'
-
-lines:
-       @find . \( -name '*.[ch]' -o -name '*.cc' -o -name '*.hh' \) \
-       -exec cat {} \; | clines
-
-
-# Remaking configuration
-# ----------------------
-configure: configure.in
-       @$(PRJDIR)/mkecho $(PRJDIR) "RE-CREATING CONFIGURE"
-       autoconf configure.in >configure
-       chmod 755 configure
-
-config.status: configure
-       @$(PRJDIR)/mkecho $(PRJDIR) "RE-CHECKING CONFIGURATION (re-creating config.status from configure)"
-       @if [ -x ./config.status ]; then \
-         ./config.status -recheck;\
-       else\
-         if [ -x ./conf ]; then\
-           ./conf;\
-         else\
-           ./configure;\
-         fi\
-       fi
-
-makefiles: config.status
-       @$(PRJDIR)/mkecho $(PRJDIR) "RE-MAKING MAKEFILES"
-       $(SHELL) ./config.status
-
-main.mk: $(srcdir)/main_in.mk config.status
-       @$(PRJDIR)/mkecho $(PRJDIR) "RE-MAKING MAIN.MK"
-       $(SHELL) ./config.status
-
-freshconf: echo_freshconf configure main.mk ddconfig.h
-
-ddconfig.h: ddconfig_in.h config.status
-       $(SHELL) ./config.status
-
-echo_freshconf:
-       @$(PRJDIR)/mkecho $(PRJDIR) "FRESHCONF"
-
-checkconf:
-       @$(PRJDIR)/mkecho $(PRJDIR) "CHECKCONF"
-       @if [ -f devel ]; then $(MAKE) freshconf; fi
-
-# End of Makefile
diff --git a/sim/ucsim/Makefile.in b/sim/ucsim/Makefile.in
new file mode 100644 (file)
index 0000000..0a2cccf
--- /dev/null
@@ -0,0 +1,203 @@
+#
+# uCsim Makefile
+#
+# (c) Drotos Daniel, Talker Bt. 1997,99
+#
+
+STARTYEAR      = 1997
+
+SHELL          = /bin/sh
+
+include packages.mk
+#PKGS          = cmd.src sim.src gui.src s51.src avr.src z80.src doc
+
+VPATH          = @srcdir@
+srcdir         = @srcdir@
+
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
+
+# Compiling entire program or any subproject
+# ------------------------------------------
+all: checkconf
+       $(MAKE) -f main.mk all
+       @for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg $$pkg ;\
+       done
+       $(MAKE) -f main.mk main_app
+
+libs: main.mk
+       $(MAKE) -f main.mk libs
+
+
+# Compiling and installing everything and runing test
+# ---------------------------------------------------
+.PHONY: install INSTALL Install
+install:
+       $(MAKE) -f main.mk install
+       @for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg install ;\
+       done
+
+
+# Deleting all the installed files
+# --------------------------------
+uninstall:
+       $(MAKE) -f main.mk uninstall
+       @for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg uninstall ;\
+       done
+
+
+# Deleting all files created by building the program
+# --------------------------------------------------
+clean:
+       $(MAKE) -f $(srcdir)/clean.mk clean EXEEXT=$(EXEEXT)
+       @for pkg in $(PKGS_ALL); do\
+         $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk clean EXEEXT=$(EXEEXT) ;\
+       done
+
+
+# Deleting all files created by configuring or building the program
+# -----------------------------------------------------------------
+distclean: clean
+       $(MAKE) -f $(srcdir)/clean.mk distclean
+       @for pkg in $(PKGS_ALL); do\
+         $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk distclean ;\
+       done
+       rm -rf doc/*~ doc/*.bak Makefile packages.mk libtool
+
+
+# Like clean but some files may still exist
+# -----------------------------------------
+mostlyclean: clean
+       $(MAKE) -f clean.mk mostlyclean
+       @for pkg in $(PKGS_ALL); do\
+         $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk mostlyclean ;\
+       done
+
+
+# Deleting everything that can reconstructed by this Makefile. It deletes
+# everything deleted by distclean plus files created by bison, stc.
+# -----------------------------------------------------------------------
+realclean: distclean
+       $(MAKE) -f clean.mk realclean
+       @for pkg in $(PKGS_ALL); do\
+         $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk realclean ;\
+       done
+
+
+# Creating distribution
+# ---------------------
+dist: distclean
+       @if [ -f devel ]; then\
+         rm -f devel; mkdist; touch devel;\
+       else\
+         mkdist;\
+       fi
+
+
+# Performing self-test
+# --------------------
+check:
+       $(MAKE) -f main.mk check
+       @for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg check ;\
+       done
+
+test:
+       $(MAKE) -f main.mk test
+       @for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg test ;\
+       done
+
+
+# Performing installation test
+# ----------------------------
+installcheck:
+
+
+# Creating dependencies
+# ---------------------
+dep:
+       $(MAKE) -f main.mk dep
+       @for pkg in $(PKGS); do\
+         $(MAKE) -C $$pkg dep ;\
+       done
+
+
+# My rules
+# --------
+putcopyright:
+       'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
+
+start:
+       date '+%Y.%m.%d-%H:%M' >.start
+
+newer: distclean
+       @if [ -f .start ]; then \
+         tar cvf - \
+           `find . -newer .start -type f -print` |\
+         gzip -9c >ucsim-newer-`cat .start`_`date '+%Y.%m.%d-%H:%M'`_`hostname`.tgz; \
+       else \
+         echo ".start file not found.\n"; \
+         exit 1; \
+       fi
+
+print-newer:
+       @if [ -f .start ]; then \
+         find . -newer .start -type f -print ;\
+       else \
+         echo ".start file not found.\n" ;\
+         exit 1 ;\
+       fi
+
+new_files:
+       diff -rNu $$HOME/clean-source/sdcc/sim/ucsim .|\
+       grep '^diff' | grep -v .svn | awk '{print $$4}'
+
+lines:
+       @find . \( -name '*.[ch]' -o -name '*.cc' -o -name '*.hh' \) \
+       -exec cat {} \; | clines
+
+
+# Remaking configuration
+# ----------------------
+configure: configure.in
+       @$(top_srcdir)/mkecho $(top_builddir) "RE-CREATING CONFIGURE"
+       autoconf configure.in >configure
+       chmod 755 configure
+
+config.status: configure
+       @$(top_srcdir)/mkecho $(top_builddir) "RE-CHECKING CONFIGURATION (re-creating config.status from configure)"
+       @if [ -x ./config.status ]; then \
+         ./config.status -recheck;\
+       else\
+         if [ -x ./conf ]; then\
+           ./conf;\
+         else\
+           ./configure;\
+         fi\
+       fi
+
+makefiles: config.status
+       @$(top_srcdir)/mkecho $(top_builddir) "RE-MAKING MAKEFILES"
+       $(SHELL) ./config.status
+
+main.mk: $(srcdir)/main_in.mk config.status
+       @$(top_srcdir)/mkecho $(top_builddir) "RE-MAKING MAIN.MK"
+       $(SHELL) ./config.status
+
+freshconf: echo_freshconf configure main.mk ddconfig.h
+
+ddconfig.h: ddconfig_in.h config.status
+       $(SHELL) ./config.status
+
+echo_freshconf:
+       @$(top_srcdir)/mkecho $(top_builddir) "FRESHCONF"
+
+checkconf:
+       @$(top_srcdir)/mkecho $(top_builddir) "CHECKCONF"
+       @if [ -f devel ]; then $(MAKE) freshconf; fi
+
+# End of Makefile
index f2e1ed16bd2a4abebbc10c1b2a05511568a8c990..f05e68d813f093ce1c3635e63e2bb9e7dff1b6ed 100644 (file)
@@ -14,11 +14,13 @@ RANLIB              = @RANLIB@
 INSTALL                = @INSTALL@
 STRIP          = @STRIP@
 
-PRJDIR         = ..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
-                 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
+CPPFLAGS        = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
+                 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/sim.src \
+                 -I$(top_srcdir)/gui.src
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
@@ -26,7 +28,7 @@ PICOPT                = @PICOPT@
 SHAREDLIB      = @SHAREDLIB@
 EXEEXT         = @EXEEXT@
 
-LIBS           = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
+LIBS           = @LIBS@ -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim
 DL             = @DL@
 dl_ok          = @dl_ok@
 
@@ -41,6 +43,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 OBJECTS_SHARED = glob.o \
                  simavr.o avr.o port.o \
@@ -97,11 +100,11 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: *.cc *.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $^ >Makefile.dep
 
 include Makefile.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 #parser.cc: parser.y
 
@@ -113,23 +116,23 @@ include clean.mk
 
 avr.src: savr$(EXEEXT) shared_lib
 
-savr$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
+savr$(EXEEXT): $(OBJECTS) $(top_builddir)*.a
        $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
 
 ifeq ($(dlso_ok),yes)
-shared_lib: $(PRJDIR)/savr.so
+shared_lib: $(top_builddir)savr.so
 else
 shared_lib:
-       @$(PRJDIR)/mkecho $(PRJDIR) "No AVR shared lib made."
-       @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
+       @$(top_srcdir)/mkecho $(top_builddir) "No AVR shared lib made."
+       @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
 endif
 
-$(PRJDIR)/savr.so: $(OBJECTS_SHARED)
-       $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/savr.so
+$(top_builddir)savr.so: $(OBJECTS_SHARED)
+       $(CXX) -shared $(OBJECTS_SHARED) -o $(top_builddir)savr.so
 
 otherlibs:
-       cd $(PRJDIR)/cmd.src && $(MAKE) all
-       cd $(PRJDIR)/sim.src && $(MAKE) all
+       $(MAKE) -C $(top_builddir)cmd.src all
+       $(MAKE) -C $(top_builddir)sim.src all
 
 .cc.o:
        $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
@@ -141,8 +144,8 @@ otherlibs:
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of avr.src/Makefile.in
index 7097e848ef74e30603db35e95a31a2b1332c44af..d61802a16324da4348dce51791fbfdf159a73d89 100644 (file)
@@ -5,7 +5,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of avr.src/conf.mk
index 84fff8d4b339ea24d0ea88d78b93f5bfd505dd25..4411323ee52a143b8505ecfc18b14fe3f54a705f 100644 (file)
@@ -9,7 +9,7 @@ clean:
 # -----------------------------------------------------------------
 distclean: clean
        rm -f config.cache config.log config.status
-       rm -f ddconfig.h main.mk *.dep
+       rm -f ddconfig.h main.mk Makefile *.dep
        rm -rf autom4te.cache
 
 
index 644c9df3e2dc1fd4418258fb7c01ba8020179dbe..b9364dfa9c06772ed16d80b8ec030cdc6850fd48 100644 (file)
@@ -17,11 +17,12 @@ LEX         = @LEX@
 YACC           = @YACC@
 BISON_PLUS_PLUS        = @BISON_PLUS_PLUS@
 
-PRJDIR         = ..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
-                 -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
+CPPFLAGS        = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
+                 -I$(top_srcdir)/sim.src -I$(top_srcdir)/gui.src
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
@@ -37,13 +38,14 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 OBJECTS                = cmdset.o command.o newcmd.o cmdutil.o syntax.o \
                  get.o set.o timer.o bp.o info.o show.o cmdgui.o cmdconf.o \
                  cmduc.o cmdstat.o cmdmem.o \
                  cmdpars.o cmdlex.o
 
-DEVEL          = $(shell ( bash -c "test -e $(PRJDIR)/devel && echo yes" ))
+DEVEL          = $(shell ( bash -c "test -e $(top_builddir)devel && echo yes" ))
 
 # Compiling entire program or any subproject
 # ------------------------------------------
@@ -83,11 +85,11 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: *.cc *.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $^ >Makefile.dep
 
 include Makefile.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 cmdpars.cc: cmdpars.y
 
@@ -98,9 +100,9 @@ endif
 # My rules
 # --------
 
-cmdlib: $(PRJDIR)/libcmd.a
+cmdlib: $(top_builddir)libcmd.a
 
-$(PRJDIR)/libcmd.a: $(OBJECTS)
+$(top_builddir)libcmd.a: $(OBJECTS)
        ar -rcu $*.a $(OBJECTS)
        $(RANLIB) $*.a
 
@@ -127,8 +129,8 @@ endif
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of cmd.src/Makefile.in
index 4bb2a6e256a38379a2c8c146b4ab13bf591138c4..950756883196af669403b47ee54cbc0c5756e1a7 100644 (file)
@@ -6,7 +6,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of cmd.src/conf.mk
index 3c63d5f41f675ab94e863981e1a7f0aca475d6f4..48b58e58519d30f6772a4f22409e5ee9bcfad469 100755 (executable)
@@ -1023,8 +1023,8 @@ Optional Features:
   --enable-dlso           compile dynamically loadable shared libraries
   --disable-51            do not compile simulator for MCS51
   --disable-avr           do not compile simulator for AVR
-  --enable-z80            compile simulator for Z80
-  --enable-hc08           compile simulator for hc08
+  --disable-z80           do not compile simulator for Z80
+  --disable-hc08          do not compile simulator for hc08
   --enable-xa             compile simulator for XA
   --enable-serio          compile serio GUI tool (needs curses)
   --enable-statistic      compile statistical features (slower simulation)
@@ -1143,7 +1143,7 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd "$ac_popdir"
+    cd $ac_popdir
   done
 fi
 
@@ -1536,8 +1536,8 @@ done
 
 echo "$as_me:$LINENO: checking version of the package" >&5
 echo $ECHO_N "checking version of the package... $ECHO_C" >&6
-if test -f .version; then
-  VERSION=`cat .version`
+if test -f ${srcdir}/.version; then
+  VERSION=`cat ${srcdir}/.version`
   echo "$as_me:$LINENO: result: $VERSION" >&5
 echo "${ECHO_T}$VERSION" >&6
 else
@@ -1622,7 +1622,7 @@ if test "${enable_z80+set}" = set; then
     enable_z80="yes"
 fi
 else
-  enable_z80="no"
+  enable_z80="yes"
 fi;
 # Check whether --enable-hc08 or --disable-hc08 was given.
 if test "${enable_hc08+set}" = set; then
@@ -2023,7 +2023,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2081,7 +2082,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2152,7 +2154,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2196,7 +2199,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3169,7 +3173,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3227,7 +3232,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3343,7 +3349,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3397,7 +3404,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3442,7 +3450,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3486,7 +3495,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4366,7 +4376,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4536,7 +4547,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4603,7 +4615,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5037,7 +5050,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5040 "configure"' > conftest.$ac_ext
+  echo '#line 5053 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -5099,7 +5112,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5447,7 +5461,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5547,7 +5562,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5610,7 +5626,7 @@ chmod -w .
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
 compiler_c_o=no
-if { (eval echo configure:5613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+if { (eval echo configure:5629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
   # The compiler can only warn and ignore the option if not recognized
   # So say no if there are warnings
   if test -s out/conftest.err; then
@@ -5674,7 +5690,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5775,7 +5792,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7111,7 +7129,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7176,7 +7195,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7269,7 +7289,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7334,7 +7355,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7400,7 +7422,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7466,7 +7489,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7541,7 +7565,7 @@ else
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 7544 "configure"
+#line 7568 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -7639,7 +7663,7 @@ else
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 7642 "configure"
+#line 7666 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -8454,7 +8478,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8520,7 +8545,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8609,7 +8635,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8778,7 +8805,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8944,7 +8972,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9093,7 +9122,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9238,7 +9268,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9410,7 +9441,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9558,7 +9590,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9630,7 +9663,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9684,7 +9718,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9755,7 +9790,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9809,7 +9845,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10007,7 +10044,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10080,7 +10118,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10152,7 +10191,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
 
 
 
+
+#AC_CHECK_LIB(panel,panel_above,
+#panel_ok="yes"
+#curses_ok="yes"
+#CURSES_LIBS="-lpanel -lcurses"
+#,
+#panel_ok="no"
+#AC_CHECK_LIB(curses,nl,
+#curses_ok="yes"
+#CURSES_LIBS="-lcurses"
+#,
+#curses_ok="no")
+#,
+#-lcurses)
+
 echo "$as_me:$LINENO: checking for panel_above in -lpanel" >&5
 echo $ECHO_N "checking for panel_above in -lpanel... $ECHO_C" >&6
 if test "${ac_cv_lib_panel_panel_above+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpanel -lcurses $LIBS"
+LIBS="-lpanel  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10225,7 +10280,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10253,11 +10309,16 @@ echo "${ECHO_T}$ac_cv_lib_panel_panel_above" >&6
 if test $ac_cv_lib_panel_panel_above = yes; then
   panel_ok="yes"
 curses_ok="yes"
-CURSES_LIBS="-lpanel -lcurses"
-
+CURSES_LIBS="-lpanel"
 else
   panel_ok="no"
-echo "$as_me:$LINENO: checking for nl in -lcurses" >&5
+curses_ok="no"
+
+fi
+
+
+if test $curses_ok != yes; then
+  echo "$as_me:$LINENO: checking for nl in -lcurses" >&5
 echo $ECHO_N "checking for nl in -lcurses... $ECHO_C" >&6
 if test "${ac_cv_lib_curses_nl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10295,7 +10356,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10322,12 +10384,84 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_nl" >&5
 echo "${ECHO_T}$ac_cv_lib_curses_nl" >&6
 if test $ac_cv_lib_curses_nl = yes; then
   curses_ok="yes"
-CURSES_LIBS="-lcurses"
-
+  CURSES_LIBS="-lcurses"
 else
-  ncurses_ok="no"
+  curses_ok="no"
 fi
 
+fi
+
+if test $curses_ok != yes; then
+  echo "$as_me:$LINENO: checking for nl in -lncurses" >&5
+echo $ECHO_N "checking for nl in -lncurses... $ECHO_C" >&6
+if test "${ac_cv_lib_ncurses_nl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char nl ();
+int
+main ()
+{
+nl ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ncurses_nl=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ncurses_nl=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_nl" >&5
+echo "${ECHO_T}$ac_cv_lib_ncurses_nl" >&6
+if test $ac_cv_lib_ncurses_nl = yes; then
+  curses_ok="yes"
+  CURSES_LIBS="-lncurses"
+else
+  curses_ok="no"
+fi
 
 fi
 
@@ -10404,7 +10538,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10498,7 +10633,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10603,7 +10739,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10704,7 +10841,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10812,7 +10950,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10914,7 +11053,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11015,7 +11155,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11116,7 +11257,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11308,7 +11450,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11403,7 +11546,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11445,7 +11589,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11502,7 +11647,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11820,7 +11966,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11882,7 +12029,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11944,7 +12092,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11984,7 +12133,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12040,7 +12190,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12080,7 +12231,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12144,7 +12296,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12175,8 +12328,10 @@ See \`config.log' for more details." >&2;}
 esac
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -12288,7 +12443,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12350,7 +12506,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12390,7 +12547,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12446,7 +12604,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12486,7 +12645,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12550,7 +12710,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12581,8 +12742,10 @@ See \`config.log' for more details." >&2;}
 esac
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -12694,7 +12857,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12756,7 +12920,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12796,7 +12961,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12852,7 +13018,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12892,7 +13059,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12956,7 +13124,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12987,8 +13156,10 @@ See \`config.log' for more details." >&2;}
 esac
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13100,7 +13271,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13162,7 +13334,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13202,7 +13375,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13258,7 +13432,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13298,7 +13473,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13362,7 +13538,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13393,8 +13570,10 @@ See \`config.log' for more details." >&2;}
 esac
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13506,7 +13685,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13568,7 +13748,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13608,7 +13789,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13664,7 +13846,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13704,7 +13887,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13768,7 +13952,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13799,8 +13984,10 @@ See \`config.log' for more details." >&2;}
 esac
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13971,7 +14158,7 @@ _ACEOF
 # Generating output files
 # ===========================================================================
 
-                                                                                                                        ac_config_files="$ac_config_files main.mk:main_in.mk packages.mk:packages_in.mk sim.src/Makefile cmd.src/Makefile s51.src/Makefile avr.src/Makefile z80.src/Makefile hc08.src/Makefile xa.src/Makefile gui.src/Makefile gui.src/serio.src/Makefile doc/Makefile"
+                                                                                                                                  ac_config_files="$ac_config_files Makefile main.mk:main_in.mk packages.mk:packages_in.mk sim.src/Makefile cmd.src/Makefile s51.src/Makefile avr.src/Makefile z80.src/Makefile hc08.src/Makefile xa.src/Makefile gui.src/Makefile gui.src/serio.src/Makefile doc/Makefile"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -14497,6 +14684,7 @@ for ac_config_target in $ac_config_targets
 do
   case "$ac_config_target" in
   # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "main.mk" ) CONFIG_FILES="$CONFIG_FILES main.mk:main_in.mk" ;;
   "packages.mk" ) CONFIG_FILES="$CONFIG_FILES packages.mk:packages_in.mk" ;;
   "sim.src/Makefile" ) CONFIG_FILES="$CONFIG_FILES sim.src/Makefile" ;;
@@ -14822,6 +15010,11 @@ esac
   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -14860,12 +15053,6 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
         fi;;
       esac
     done` || { (exit 1); exit 1; }
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
index 1c9e059299a83df2a3f4ff4688785e890b7edbb4..1faa094bc76b06e261e2d1e6f9c5bb3f56050344 100644 (file)
@@ -6,8 +6,8 @@ AC_CONFIG_HEADER(ddconfig.h:ddconfig_in.h)
 AC_PROG_AWK
 
 AC_MSG_CHECKING(version of the package)
-if test -f .version; then
-  VERSION=`cat .version`
+if test -f ${srcdir}/.version; then
+  VERSION=`cat ${srcdir}/.version`
   AC_MSG_RESULT($VERSION)
 else
   VERSION="0.0.0"
@@ -60,13 +60,13 @@ if test $enable_avr != "no"; then
 fi,
 enable_avr="yes")
 AC_ARG_ENABLE(z80,
-[  --enable-z80            compile simulator for Z80],
+[  --disable-z80           do not compile simulator for Z80],
 if test $enable_z80 != "no"; then
     enable_z80="yes"
 fi,
-enable_z80="no")
+enable_z80="yes")
 AC_ARG_ENABLE(hc08,
-[  --enable-hc08           compile simulator for hc08],
+[  --disable-hc08          do not compile simulator for hc08],
 if test $enable_hc08 != "no"; then
     enable_hc08="yes"
 fi,
@@ -201,19 +201,43 @@ dl_ok="no"
 DL="")
 AC_SUBST(dl_ok)
 AC_SUBST(DL)
+
+#AC_CHECK_LIB(panel,panel_above,
+#panel_ok="yes"
+#curses_ok="yes"
+#CURSES_LIBS="-lpanel -lcurses"
+#,
+#panel_ok="no"
+#AC_CHECK_LIB(curses,nl,
+#curses_ok="yes"
+#CURSES_LIBS="-lcurses"
+#,
+#curses_ok="no")
+#,
+#-lcurses)
+
 AC_CHECK_LIB(panel,panel_above,
 panel_ok="yes"
 curses_ok="yes"
-CURSES_LIBS="-lpanel -lcurses"
-,
+CURSES_LIBS="-lpanel",
 panel_ok="no"
-AC_CHECK_LIB(curses,nl,
-curses_ok="yes"
-CURSES_LIBS="-lcurses"
-,
-ncurses_ok="no")
-,
--lcurses)
+curses_ok="no"
+)
+
+if test $curses_ok != yes; then
+  AC_CHECK_LIB(curses,nl,
+  curses_ok="yes"
+  CURSES_LIBS="-lcurses",
+  curses_ok="no")
+fi
+
+if test $curses_ok != yes; then
+  AC_CHECK_LIB(ncurses,nl,
+  curses_ok="yes"
+  CURSES_LIBS="-lncurses",
+  curses_ok="no")
+fi
+
 AC_SUBST(panel_ok)
 AC_SUBST(curses_ok)
 AC_SUBST(CURSES_LIBS)
@@ -491,7 +515,8 @@ AC_DEFINE_UNQUOTED(_M_, "${M}")
 # Generating output files
 # ===========================================================================
 
-AC_OUTPUT(main.mk:main_in.mk
+AC_OUTPUT(Makefile
+main.mk:main_in.mk
 packages.mk:packages_in.mk
 sim.src/Makefile
 cmd.src/Makefile
index ddcbc6ee30667475269784c5376bf78a26316522..2f540fc001ec6f6f004b7fabed69002390e324b3 100644 (file)
@@ -9,7 +9,8 @@ STARTYEAR       = 1997
 SHELL          = /bin/sh
 INSTALL                = @INSTALL@
 
-PRJDIR         = ..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 prefix          = @prefix@
 exec_prefix     = @exec_prefix@
@@ -22,6 +23,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 #docdir                = $(prefix)/share/doc/ucsim
 docdir         = @docdir@/ucsim
 
@@ -35,10 +37,10 @@ doc: checkconf
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
 install: all installdirs
-       cp *.html $(DESTDIR)$(docdir)
-       cp *.gif $(DESTDIR)$(docdir)
-       cp *.jpg $(DESTDIR)$(docdir)
-       cp *.fig $(DESTDIR)$(docdir)
+       cp $(srcdir)/*.html $(DESTDIR)$(docdir)
+       cp $(srcdir)/*.gif $(DESTDIR)$(docdir)
+       cp $(srcdir)/*.jpg $(DESTDIR)$(docdir)
+       cp $(srcdir)/*.fig $(DESTDIR)$(docdir)
 
 
 # Deleting all the installed files
@@ -67,7 +69,7 @@ installdirs:
 
 # Creating dependencies
 # ---------------------
-include clean.mk
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
@@ -75,8 +77,8 @@ include clean.mk
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of s51.src/Makefile.in
index 879e9bc8ad388e192c0c0849fde78cd7cba43a4f..ac65f24e50330b37d67254e462848ec49ec1d299 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of conf.mk
index b1a0077134effe528c1a329bde69bf18ddb9d615..ac1dcba053f621ede5c5db1d616fc1031c3d6eae 100644 (file)
@@ -11,16 +11,17 @@ CXXCPP              = @CXXCPP@
 RANLIB         = @RANLIB@
 INSTALL                = @INSTALL@
 
-PRJDIR         = ..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
-                 -I$(PRJDIR)/sim.src -I$(PRJDIR)/cmd.src
+CPPFLAGS        = @CPPFLAGS@ -I$(srcdir) -I$(top_builddir) -I$(top_srcdir) \
+                 -I$(top_srcdir)/sim.src -I$(top_srcdir)/cmd.src
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
 
-LIBS           = @LIBS@ @CURSES_LIBS@ -L$(PRJDIR)
+LIBS           = @LIBS@ @CURSES_LIBS@ -L$(top_builddir)
 
 curses_ok      = @curses_ok@
 
@@ -35,6 +36,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 enable_serio   = @enable_serio@
 PKGS           =
@@ -67,7 +69,7 @@ all: gui.src
 gui.src: checkconf gui_api
 ifeq ($(curses_ok),yes)
        @for pkg in dummy $(CURSES_PKGS); do\
-         if test -d $$pkg; then $(MAKE) -C $$pkg $$pkg; else : ; fi ;\
+         if test -f $$pkg/Makefile; then $(MAKE) -C $$pkg $$pkg; else : ; fi ;\
        done
 endif
 #      @for pkg in $(PKGS); do\
@@ -82,7 +84,7 @@ gui_api: ucsim_lib tool_lib
 install: install_gui_api
 ifeq ($(curses_ok),yes)
        @for pkg in $(CURSES_PKGS); do\
-         cd $$pkg && $(MAKE) install ; cd ..;\
+         $(MAKE) -C $$pkg install ; cd ..;\
        done
 endif
 
@@ -94,7 +96,7 @@ install_gui_api:
 uninstall: uninstall_gui_api
 ifeq ($(curses_ok),yes)
        @for pkg in $(CURSES_PKGS); do\
-         cd $$pkg && $(MAKE) uninstall ; cd ..;\
+         $(MAKE) -C $$pkg uninstall ; cd ..;\
        done
 endif
 
@@ -105,14 +107,14 @@ uninstall_gui_api:
 # --------------------
 check: check_local
        @for pkg in $(CURSES_PKGS); do\
-         cd $$pkg && $(MAKE) check ; cd ..;\
+         $(MAKE) -C $$pkg check ; cd ..;\
        done
 
 check_local:
 
 test: test_local
        @for pkg in $(CURSES_PKGS); do\
-         cd $$pkg && $(MAKE) test ; cd ..;\
+         $(MAKE) -C $$pkg test ; cd ..;\
        done
 
 test_local:
@@ -122,7 +124,7 @@ test_local:
 # ----------------------------
 installcheck: installcheck_gui_api
        @for pkg in $(CURSES_PKGS); do\
-         cd $$pkg && $(MAKE) installcheck ; cd ..;\
+         $(MAKE) -C $$pkg installcheck ; cd ..;\
        done
 
 installcheck_gui_api:
@@ -132,7 +134,7 @@ installcheck_gui_api:
 # ---------------------------------
 installdirs:
        @for pkg in $(CURSES_PKGS); do\
-         cd $$pkg && $(MAKE) installdirs ; cd ..;\
+         $(MAKE) -C $$pkg installdirs ; cd ..;\
        done
 
 
@@ -140,24 +142,31 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: $(ALL_SOURCES) *.h
-       $(CXXCPP) -MM $(CPPFLAGS) $(M_OR_MM) $(ALL_SOURCES) >Makefile.dep
+Makefile.dep: $(ALL_SOURCES) $(srcdir)/*.h
+       $(CXXCPP) -MM $(CPPFLAGS) $(M_OR_MM) $^ >Makefile.dep
 
-include Makefile.dep
-include clean.mk
+# don't include Makefile.dep for the listed targets:
+ifeq "$(findstring $(MAKECMDGOALS),uninstall uninstall_gui_api \
+                                   check check_local test test_local \
+                                   checkconf \
+                                   clean_local clean distclean_local \
+                                   distclean mostlyclean realclean)" ""
+  include Makefile.dep
+endif
+include $(srcdir)/clean.mk
 
 
 # My rules
 # --------
-ucsim_lib: $(PRJDIR)/libguiucsim.a
+ucsim_lib: $(top_builddir)libguiucsim.a
 
-$(PRJDIR)/libguiucsim.a: $(OBJECTS) $(UCSIM_OBJECTS)
+$(top_builddir)libguiucsim.a: $(OBJECTS) $(UCSIM_OBJECTS)
        ar -rcu $*.a $(OBJECTS) $(UCSIM_OBJECTS)
        $(RANLIB) $*.a
 
-tool_lib: $(PRJDIR)/libguitool.a
+tool_lib: $(top_builddir)libguitool.a
 
-$(PRJDIR)/libguitool.a: $(OBJECTS) $(TOOL_OBJECTS)
+$(top_builddir)libguitool.a: $(OBJECTS) $(TOOL_OBJECTS)
        ar -rcu $*.a $(OBJECTS) $(TOOL_OBJECTS)
        $(RANLIB) $*.a
 
@@ -168,8 +177,8 @@ $(PRJDIR)/libguitool.a: $(OBJECTS) $(TOOL_OBJECTS)
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of gui.src/Makefile
index d5896439602ec8280b64e2e89fbc032fb9709302..826170c55e2fcc50fd4fa1c0fb918a257a3f7cb9 100644 (file)
@@ -10,7 +10,7 @@ clean_local:
 
 clean: clean_local
        @for pkg in $(PKGS); do\
-         cd $$pkg && $(MAKE) -f clean.mk clean; cd ..;\
+         $(MAKE) -C $$pkg clean;\
        done
 
 
@@ -22,7 +22,7 @@ distclean_local: clean_local
 
 distclean: distclean_local
        @for pkg in $(PKGS); do\
-         cd $$pkg && $(MAKE) -f clean.mk distclean; cd ..;\
+         $(MAKE) -C $$pkg distclean;\
        done
 
 
@@ -30,7 +30,7 @@ distclean: distclean_local
 # -----------------------------------------
 mostlyclean: clean_local
        @for pkg in $(PKGS); do\
-         cd $$pkg && $(MAKE) -f clean.mk mostlyclean; cd ..;\
+         $(MAKE) -C $$pkg mostlyclean;\
        done
 
 
@@ -39,7 +39,7 @@ mostlyclean: clean_local
 # -----------------------------------------------------------------------
 realclean: distclean_local
        @for pkg in $(PKGS); do\
-         cd $$pkg && $(MAKE) -f clean.mk realclean; cd ..;\
+         $(MAKE) $$pkg realclean;\
        done
 
 # End of gui.src/clean.mk
index 5c33eb3dbf297f4b653b67bfde761ae16dac3ad3..d9a45d91ec19fa110dbe9c6fa2e2a4539ba06d0a 100644 (file)
@@ -6,7 +6,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of gui.src/conf.mk
index 9ba4c00a83cd9304d15080892c16fb95ee49bf96..eb5b6151207f2ad3cdc08a25f75d09f9c18bc9c5 100644 (file)
@@ -11,16 +11,17 @@ CXXCPP              = @CXXCPP@
 RANLIB         = @RANLIB@
 INSTALL                = @INSTALL@
 
-PRJDIR         = ../..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 PKGDIR         = ../
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) -I$(PKGDIR)
+CPPFLAGS        = @CPPFLAGS@ -I. -I$(top_builddir) -I$(PKGDIR)
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
 
-LIBS           = -L$(PRJDIR) -L$(PKGDIR) -lgui @CURSES_LIBS@ -lutil @LIBS@
+LIBS           = -L$(top_builddir) -L$(PKGDIR) -lgui @CURSES_LIBS@ -lutil @LIBS@
 
 curses_ok      = @curses_ok@
 
@@ -77,8 +78,8 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: *.cc *.h $(PRJDIR)/*.h $(PKGDIR)/*.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(top_builddir)*.h $(PKGDIR)/*.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
 
 include Makefile.dep
 include clean.mk
@@ -95,13 +96,13 @@ else
 portmon.src:
 endif
 
-portmon: $(OBJECTS) $(PRJDIR)/*.a $(PKGDIR)/*.a
+portmon: $(OBJECTS) $(top_builddir)*.a $(PKGDIR)/*.a
        $(CXX) $(CXXFLAGS) -o portmon $(OBJECTS) $(LIBS)
 
 ifeq ($(curses_ok),yes)
 otherlibs:
-       cd $(PRJDIR) && $(MAKE) libs
-       cd $(PKGDIR) && $(MAKE) libs
+       $(MAKE) -C $(top_builddir) libs
+       $(MAKE) -C $(PKGDIR) libs
 else
 otherlibs:
 endif
@@ -123,8 +124,8 @@ endif
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of gui.src/portmon.src/Makefile.in
index b3ad7360f551e1e3019d8cebf7f38f52a7963e32..344f4f082c188dae66c96f1d3e76d7d744971f10 100644 (file)
@@ -6,7 +6,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of gui.src/portmon.src/conf.mk
index 44363c8ed3be4667211af87224c3fe36680634ce..fbfb7611b713909941fc26079e68df5729266533 100644 (file)
@@ -7,11 +7,12 @@ INSTALL               = @INSTALL@
 STRIP          = @STRIP@
 CP             = /bin/cp
 
-PRJDIR         = ../..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR)
-#                -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src
+CPPFLAGS        = @CPPFLAGS@ -I. -I$(top_builddir)
+#                -I$(top_builddir)cmd.src -I$(top_builddir)sim.src
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
@@ -33,6 +34,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 OBJECTS                = main.o fileio.o frontend.o posix_signal.o
 
@@ -83,11 +85,14 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: *.cc *.h *.hh
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h $(srcdir)/*.hh
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
 
-include Makefile.dep
-include clean.mk
+ifeq "$(findstring $(MAKECMDGOALS),uninstall installcheck installdirs checkconf \
+                                   clean distclean mostlyclean realclean)" ""
+  include Makefile.dep
+endif
+include $(srcdir)/clean.mk
 
 
 # My rules
@@ -101,8 +106,8 @@ serialview$(EXEEXT): $(OBJECTS)
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of gui.src/serio.src/Makefile.in
index a4bc1a2833c96aa317592da924fb224664cf983a..73ad16ede2330c79997db10c7940fb565fc6c9ef 100644 (file)
@@ -6,7 +6,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of gui.src/serio.src/conf.mk
index b1effd0b2f8fc63435acf948ec9225733741f56f..bee1ffdbd523973e527120cf0d11309ded310448 100644 (file)
@@ -14,11 +14,13 @@ RANLIB              = @RANLIB@
 INSTALL                = @INSTALL@
 STRIP          = @STRIP@
 
-PRJDIR         = ..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
-                 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
+CPPFLAGS        = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
+                 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/sim.src \
+                 -I$(top_srcdir)/gui.src
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
@@ -27,7 +29,7 @@ SHAREDLIB     = @SHAREDLIB@
 
 EXEEXT          = @EXEEXT@
 
-LIBS           = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
+LIBS           = @LIBS@ -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim
 DL             = @DL@
 dl_ok          = @dl_ok@
 
@@ -42,6 +44,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 OBJECTS_SHARED = glob.o \
                  inst.o \
@@ -99,11 +102,11 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: *.cc *.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $^ >Makefile.dep
 
 include Makefile.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
@@ -111,23 +114,23 @@ include clean.mk
 
 hc08.src: shc08$(EXEEXT)  shared_lib
 
-shc08$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
+shc08$(EXEEXT): $(OBJECTS) $(top_builddir)*.a
        $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
 
 ifeq ($(dlso_ok),yes)
-shared_lib: $(PRJDIR)/shc08.so
+shared_lib: $(top_builddir)shc08.so
 else
 shared_lib:
-       @$(PRJDIR)/mkecho $(PRJDIR) "No hc08 shared lib made."
-       @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
+       @$(top_srcdir)/mkecho $(top_builddir) "No hc08 shared lib made."
+       @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
 endif
 
-$(PRJDIR)/shc08.so: $(OBJECTS_SHARED)
-       $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/shc08.so
+$(top_builddir)shc08.so: $(OBJECTS_SHARED)
+       $(CXX) -shared $(OBJECTS_SHARED) -o $(top_builddir)shc08.so
 
 otherlibs:
-       cd $(PRJDIR)/cmd.src && $(MAKE) all
-       cd $(PRJDIR)/sim.src && $(MAKE) all
+       $(MAKE) -C $(top_builddir)cmd.src all
+       $(MAKE) -C $(top_builddir)sim.src all
 
 .cc.o:
        $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
@@ -139,8 +142,8 @@ otherlibs:
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of hc08.src/Makefile.in
index 9ab5ebc626710185eefe08da078d39c421c5f30e..a7a0769c6f3d8dd1e1b6f139c6a7100a9cb575e0 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of hc08.src/conf.mk
index 99011b3fc0bebbaaaa52eaa20be4e4a5bf77d948..06c4dd1e51a94e0c7d44ffda85ef925881729dbf 100644 (file)
@@ -155,12 +155,12 @@ distclean-libtool:
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
        cd $(top_srcdir) && \
          $(AUTOMAKE) --foreign  Makefile
-Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)config.status
        cd $(top_builddir) && \
          CONFIG_HEADERS= CONFIG_LINKS= \
          CONFIG_FILES=$@ $(SHELL) ./config.status
 
-$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+$(top_builddir)config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
        $(SHELL) ./config.status --recheck
 $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
        cd $(srcdir) && $(AUTOCONF)
@@ -172,7 +172,7 @@ config.h: stamp-h
                rm -f stamp-h; \
                $(MAKE) stamp-h; \
        else :; fi
-stamp-h: $(srcdir)/config-h.in $(top_builddir)/config.status
+stamp-h: $(srcdir)/config-h.in $(top_builddir)config.status
        @rm -f stamp-h stamp-hT
        @echo timestamp > stamp-hT 2> /dev/null
        cd $(top_builddir) \
index 3a77bac642c240f6f3ade5f5e4faa5f86fea765f..dc2e3e4cf0defa063d3a305acc426d1dfc1289d2 100644 (file)
@@ -13,17 +13,19 @@ CXXCPP              = @CXXCPP@
 RANLIB         = @RANLIB@
 INSTALL                = @INSTALL@
 
-PRJDIR         = .
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 SIMDIR         = sim.src
 CMDDIR         = cmd.src
 GUIDIR         = gui.src
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
 # FIXME: -Imcs51 must be removed!!!
-CPPFLAGS        = @CPPFLAGS@ -I$(PRJDIR) -I$(PRJDIR)/$(SIMDIR) \
-                 -I$(CMDDIR) -I$(GUIDIR)
-CFLAGS          = @CFLAGS@ -I$(PRJDIR) -Wall
-CXXFLAGS        = @CXXFLAGS@ -I$(PRJDIR) -Wall
+CPPFLAGS        = @CPPFLAGS@ -I$(top_builddir). -I$(srcdir) \
+                  -I$(top_srcdir)/$(SIMDIR) \
+                 -I$(top_srcdir)/$(CMDDIR) -I$(top_srcdir)/$(GUIDIR)
+CFLAGS          = @CFLAGS@ -I$(top_builddir) -Wall
+CXXFLAGS        = @CXXFLAGS@ -I$(top_builddir) -Wall
 M_OR_MM         = @M_OR_MM@
 
 EXEEXT         = @EXEEXT@
@@ -43,6 +45,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 OBJECTS         = pobj.o globals.o utils.o error.o app.o option.o
 SOURCES                = $(patsubst %.o,%.cc,$(OBJECTS))
@@ -95,11 +98,11 @@ installdirs:
 # ---------------------
 dep: main.dep
 
-main.dep: $(ALL_SOURCES) *.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(ALL_SOURCES) >main.dep
+main.dep: $(ALL_SOURCES) *.h $(srcdir)/*.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $^ >main.dep
 
 include main.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 #parser.cc: parser.y
 
@@ -120,7 +123,7 @@ endif
 
 ucsim: $(UCSIM_OBJECTS) $(UCSIM_LIB_FILES)
        echo $(UCSIM_LIB_FILES)
-       $(CXX) $(CXXFLAGS) -o $@ $< -L$(PRJDIR) $(UCSIM_LIBS)
+       $(CXX) $(CXXFLAGS) -o $@ $< -L$(top_builddir) $(UCSIM_LIBS)
 
 ptt: ptt.o
        $(CXX) $(CXXFLAGS) -o $@ $< -lpthread
@@ -132,7 +135,7 @@ ptt: ptt.o
 # ----------------------
 checkconf:
        @if [ -f devel ]; then\
-         $(PRJDIR)/mkecho $(PRJDIR) "MAIN.MK checkconf";\
+         $(top_srcdir)/mkecho $(top_builddir) "MAIN.MK checkconf";\
          $(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\
        fi
 
index 4027b938a5c76ea97f646f0ceb0141563966d9a5..60e192af44f1e1921e31225682a1ab95e838fc60 100644 (file)
@@ -38,3 +38,5 @@ endif
 
 PKGS           = cmd.src sim.src gui.src $(S51) $(SAVR) $(SZ80) $(XA) \
                  $(SHC08) doc
+PKGS_ALL       = cmd.src sim.src gui.src s51.src avr.src z80.src xa.src \
+                 hc08.src doc
index 8a5b2e4722004c8fe66675ba693aaa3609031732..357ba6aaad423ef74a7d1c4e5ce2581cf6831085 100644 (file)
@@ -14,11 +14,13 @@ RANLIB              = @RANLIB@
 INSTALL                = @INSTALL@
 STRIP          = @STRIP@
 
-PRJDIR         = ..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
-                 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
+CPPFLAGS        = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
+                 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/sim.src \
+                 -I$(top_srcdir)/gui.src
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
@@ -29,7 +31,7 @@ SDCC          = sdcc
 SDCFLAGS       = --debug --stack-after-data --model-small
 SDCPPFLAGS     = 
 
-LIBS           = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
+LIBS           = @LIBS@ -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim
 DL             = @DL@
 dl_ok          = @dl_ok@
 
@@ -44,6 +46,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 EXEEXT         = @EXEEXT@
 
@@ -102,11 +105,11 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: *.cc *.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $^ >Makefile.dep
 
 include Makefile.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 #parser.cc: parser.y
 
@@ -118,25 +121,25 @@ include clean.mk
 
 s51.src: s51$(EXEEXT) shared_lib
 
-s51$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
+s51$(EXEEXT): $(OBJECTS) $(top_builddir)*.a
        $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
 
 ifeq ($(dlso_ok),yes)
-shared_lib: $(PRJDIR)/s51.so
+shared_lib: $(top_builddir)s51.so
 else
 shared_lib:
-       @$(PRJDIR)/mkecho $(PRJDIR) "No 51 shared lib made."
-       @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
+       @$(top_srcdir)/mkecho $(top_builddir) "No 51 shared lib made."
+       @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
 endif
 
-$(PRJDIR)/s51.so: $(OBJECTS_SHARED)
+$(top_builddir)s51.so: $(OBJECTS_SHARED)
        $(CXX) -shared $(OBJECTS_SHARED) -o $@
 
 otherlibs:
-       cd $(PRJDIR) && $(MAKE) libs
-       cd $(PRJDIR)/cmd.src && $(MAKE) all
-       cd $(PRJDIR)/sim.src && $(MAKE) all
-       $(MAKE) -C $(PRJDIR)/gui.src checkconf ucsim_lib
+       $(MAKE) -C $(top_builddir) libs
+       $(MAKE) -C $(top_builddir)cmd.src all
+       $(MAKE) -C $(top_builddir)sim.src all
+       $(MAKE) -C $(top_builddir)gui.src checkconf ucsim_lib
 
 .cc.o:
        $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
@@ -148,8 +151,8 @@ otherlibs:
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of s51.src/Makefile.in
index 3f6e75a5c0a6f4ac107d7676c2c142ac32eb1799..ca9aeb98aee5e38e342a281b4ca1e5c6b21d33db 100644 (file)
@@ -5,7 +5,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of s51.src/conf.mk
index 50a17eea0b4054350689a2d0b4b2cf3ed46c9a09..2be834c52c9c2cab01999d257b5480c58d853ffc 100644 (file)
@@ -13,11 +13,12 @@ CXXCPP              = @CXXCPP@
 RANLIB         = @RANLIB@
 INSTALL                = @INSTALL@
 
-PRJDIR         = ..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
-                 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/gui.src
+CPPFLAGS        = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
+                 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/gui.src
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
@@ -33,6 +34,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 OBJECTS         = stack.o mem.o sim.o itsrc.o brk.o arg.o \
                  guiobj.o uc.o hw.o
@@ -42,8 +44,8 @@ OBJECTS         = stack.o mem.o sim.o itsrc.o brk.o arg.o \
 # ------------------------------------------
 all: checkconf sim_lib
 
-test_mem_speed: $(PRJDIR)/lib*.a test_mem_speed.o
-       $(CXX) -o $@ test_mem_speed.o -L$(PRJDIR) -Wl,--start-group -lsim -lutil -lcmd -Wl,--end-group
+test_mem_speed: $(top_builddir)lib*.a test_mem_speed.o
+       $(CXX) -o $@ test_mem_speed.o -L$(top_builddir) -Wl,--start-group -lsim -lutil -lcmd -Wl,--end-group
 
 sim.src: all
 
@@ -79,11 +81,11 @@ installdirs:
 # ---------------------
 dep: main.dep
 
-Makefile.dep: *.cc *.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $^ >Makefile.dep
 
 include Makefile.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 #parser.cc: parser.y
 
@@ -92,9 +94,9 @@ include clean.mk
 # My rules
 # --------
 
-sim_lib: $(PRJDIR)/libsim.a
+sim_lib: $(top_builddir)libsim.a
 
-$(PRJDIR)/libsim.a: $(OBJECTS)
+$(top_builddir)libsim.a: $(OBJECTS)
        ar -rcu $*.a $(OBJECTS)
        $(RANLIB) $*.a
 
@@ -115,8 +117,8 @@ $(PRJDIR)/libsim.a: $(OBJECTS)
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of sim.src/Makefile
index 879e9bc8ad388e192c0c0849fde78cd7cba43a4f..ed2b48ab6d0e232e30f5ab5d7533fa5a1ff8be51 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of conf.mk
index a437fc8508d5558201d66de7e865a7a6339c8663..bd69b4947adfd6dc53bbe76c7a9a509df510c4bf 100644 (file)
@@ -14,18 +14,20 @@ RANLIB              = @RANLIB@
 INSTALL                = @INSTALL@
 STRIP          = @STRIP@
 
-PRJDIR         = ..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 EXEEXT         = @EXEEXT@
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
-                 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
+CPPFLAGS        = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
+                 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/sim.src \
+                 -I$(top_srcdir)/gui.src
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
 
-LIBS           = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
+LIBS           = @LIBS@ -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim
 
 prefix          = @prefix@
 exec_prefix     = @exec_prefix@
@@ -38,6 +40,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 OBJECTS         = sxa.o glob.o \
                  inst.o \
@@ -88,11 +91,11 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: *.cc *.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $^ >Makefile.dep
 
 include Makefile.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
@@ -100,12 +103,12 @@ include clean.mk
 
 xa.src: sxa$(EXEEXT)
 
-sxa$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
+sxa$(EXEEXT): $(OBJECTS) $(top_builddir)*.a
        $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
 
 otherlibs:
-       cd $(PRJDIR)/cmd.src && $(MAKE) all
-       cd $(PRJDIR)/sim.src && $(MAKE) all
+       $(MAKE) -C $(top_builddir)cmd.src all
+       $(MAKE) -C $(top_builddir)sim.src all
 
 .cc.o:
        $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
@@ -117,8 +120,8 @@ otherlibs:
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of xa.src/Makefile.in
index 1c008560f1ec82aba0cfbb09240a766404c95d9f..e6db37c039f46008c2371e9c00b40cc56458e48f 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of xa.src/conf.mk
index fac494d761af457569aa62307632151b56c741c0..f99d384f0849d690abbc6ecbdef9dc80f46a6168 100644 (file)
@@ -14,11 +14,13 @@ RANLIB              = @RANLIB@
 INSTALL                = @INSTALL@
 STRIP          = @STRIP@
 
-PRJDIR         = ..
+top_builddir   = @top_builddir@
+top_srcdir     = @top_srcdir@
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
-                 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
+CPPFLAGS        = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
+                 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/sim.src \
+                 -I$(top_srcdir)/gui.src
 CFLAGS          = @CFLAGS@ -Wall
 CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
@@ -26,7 +28,7 @@ PICOPT                = @PICOPT@
 SHAREDLIB      = @SHAREDLIB@
 EXEEXT         = @EXEEXT@
 
-LIBS           = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
+LIBS           = @LIBS@ -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim
 DL             = @DL@
 dl_ok          = @dl_ok@
 
@@ -41,6 +43,7 @@ man1dir         = $(mandir)/man1
 man2dir         = $(mandir)/man2
 infodir         = @infodir@
 srcdir          = @srcdir@
+VPATH           = @srcdir@
 
 OBJECTS_SHARED = glob.o \
                  inst.o \
@@ -104,11 +107,11 @@ installdirs:
 # ---------------------
 dep: Makefile.dep
 
-Makefile.dep: *.cc *.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
 
 include Makefile.dep
-include clean.mk
+include $(srcdir)/clean.mk
 
 # My rules
 # --------
@@ -116,23 +119,23 @@ include clean.mk
 
 z80.src: sz80$(EXEEXT) shared_lib
 
-sz80$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
+sz80$(EXEEXT): $(OBJECTS) $(top_builddir)*.a
        $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS)
 
 ifeq ($(dlso_ok),yes)
-shared_lib: $(PRJDIR)/sz80.so
+shared_lib: $(top_builddir)sz80.so
 else
 shared_lib:
-       @$(PRJDIR)/mkecho $(PRJDIR) "No z80 shared lib made."
-       @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
+       @$(top_srcdir)/mkecho $(top_builddir) "No z80 shared lib made."
+       @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
 endif
 
-$(PRJDIR)/sz80.so: $(OBJECTS_SHARED)
-       $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/sz80.so
+$(top_builddir)sz80.so: $(OBJECTS_SHARED)
+       $(CXX) -shared $(OBJECTS_SHARED) -o $(top_builddir)sz80.so
 
 otherlibs:
-       cd $(PRJDIR)/cmd.src && $(MAKE) all
-       cd $(PRJDIR)/sim.src && $(MAKE) all
+       $(MAKE) -C $(top_builddir)cmd.src all
+       $(MAKE) -C $(top_builddir)sim.src all
 
 .cc.o:
        $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
@@ -144,8 +147,8 @@ otherlibs:
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
        fi
 
 # End of z80.src/Makefile.in
index 23bc45517f9717618c53b10bc5413fff4df56f4c..728ec31351f8257bcef9649a90279cf315de7b07 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of z80.src/conf.mk
index 46d0e4c6cd78f92b9582265a15a9c9031417eb96..6084aa72a803b4c1e0ee41e5a5fd9d8ad3eea36c 100644 (file)
@@ -2,9 +2,12 @@
 #
 #
 
-PRJDIR         = ..
+srcdir         = @srcdir@
+top_srcdir     = @top_srcdir@
+top_builddir   = @top_builddir@
+VPATH =           @srcdir@
 
-include $(PRJDIR)/Makefile.common
+include $(top_builddir)Makefile.common
 
 USE_ALT_LEX    = 0
 
@@ -15,6 +18,7 @@ PORT_LIBS     = $(PORTS:%=%/port.a)
 LIBS           = -lm @LIBS@
 
 #CFLAGS          += -Werror
+CPPFLAGS       += -I$(srcdir)
 
 ifdef SDCC_SUB_VERSION
 CFLAGS         += -DSDCC_SUB_VERSION_STR=\"$(SDCC_SUB_VERSION)\"
@@ -40,19 +44,19 @@ endif
 SLIBSOURCES    = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS))
 SOURCES                = $(patsubst %.o,%.c,$(OBJECTS))
 
-TARGET         = $(PRJDIR)/bin/sdcc$(EXEEXT)
+TARGET         = $(top_builddir)bin/sdcc$(EXEEXT)
 
 # Compiling entire program or any subproject
 # ------------------------------------------
 all: checkconf version.h $(TARGET)
 
 $(PORT_LIBS): FORCE 
-       $(MAKE) -C `dirname $@`
+       $(MAKE) -C $(dir $@)
+
 FORCE:
 
-$(PRJDIR)/support/gc/libgc.a:
-       cd $(PRJDIR)/support/gc && $(MAKE)
+$(top_builddir)support/gc/libgc.a:
+       $(MAKE) -C $(top_builddir)support/gc
 
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
@@ -86,11 +90,15 @@ installdirs:
 # ---------------------
 dep: version.h Makefile.dep
 
-Makefile.dep: version.h $(SOURCES) $(SLIBSOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h
-       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) $(SLIBSOURCES) >Makefile.dep
+Makefile.dep: version.h $(SOURCES) $(SLIBSOURCES) $(SPECIAL)
+       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
 
-include Makefile.dep
-include clean.mk
+# don't include Makefile.dep for the listed targets:
+ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \
+                                   clean distclean mostlyclean realclean)" ""
+  include Makefile.dep
+endif
+include $(srcdir)/clean.mk
 
 
 # My rules
@@ -118,7 +126,7 @@ SDCClex.c: SDCC.lex SDCCy.h
        $(LEX) -t $< >$@
 
 version.h: ../ChangeLog
-       $(AWK) -f version.awk $< > $@
+       $(AWK) -f $(srcdir)/version.awk $< > $@
 
 .y.c:
        rm -f $*.cc $*.h
@@ -134,8 +142,8 @@ version.h: ../ChangeLog
 # Remaking configuration
 # ----------------------
 checkconf:
-       @if [ -f $(PRJDIR)/devel ]; then\
-         $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
+       @if [ -f $(top_builddir)devel ]; then\
+         $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" \
          freshconf;\
        fi
 
diff --git a/src/avr/Makefile b/src/avr/Makefile
deleted file mode 100644 (file)
index 3b85636..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Make all in this directory
-include ../port.mk
diff --git a/src/avr/Makefile.in b/src/avr/Makefile.in
new file mode 100644 (file)
index 0000000..dfb8a52
--- /dev/null
@@ -0,0 +1,7 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+# Make all in this directory
+include $(srcdir)/../port.mk
index 59d80d18681b57fb82d2df402e59b9994c50f229..1ff8d7481791be7991c2239e39547aa8917afea0 100644 (file)
@@ -1,5 +1,4 @@
-CLEANALLPORTS = avr ds390 izt mcs51 pic pic16 z80 xa51
-PRJDIR = ..
+CLEANALLPORTS = avr ds390 ds400 hc08 izt mcs51 pic pic16 z80 xa51
 
 # Deleting all files created by building the program
 # --------------------------------------------------
@@ -7,9 +6,11 @@ clean:
        rm -f *core *[%~] *.[oa] *.output
        rm -f .[a-z]*~ \#*
        rm -f version.h
-       rm -f $(PRJDIR)/bin/sdcc$(EXEEXT) sdcc$(EXEEXT)
+       rm -f $(top_builddir)bin/sdcc$(EXEEXT) sdcc$(EXEEXT)
        for port in $(CLEANALLPORTS) ; do\
-         $(MAKE) -C $$port -f ../port-clean.mk clean ;\
+         if [ -f $$port/Makefile ]; then\
+           $(MAKE) -C $$port clean ;\
+         fi\
        done
 
 
@@ -17,6 +18,11 @@ clean:
 # -----------------------------------------------------------------
 distclean: clean
        rm -f Makefile *.dep
+       for port in $(CLEANALLPORTS) ; do\
+         if [ -f $$port/Makefile ]; then\
+           $(MAKE) -C $$port distclean ;\
+         fi\
+       done
 
 
 # Like clean but some files may still exist
index 879e9bc8ad388e192c0c0849fde78cd7cba43a4f..ac65f24e50330b37d67254e462848ec49ec1d299 100644 (file)
@@ -4,7 +4,7 @@
 
 freshconf: Makefile
 
-Makefile: $(srcdir)/Makefile.in $(PRJDIR)/configure.in
-       cd $(PRJDIR) && $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.in
+       cd $(top_builddir) && $(SHELL) ./config.status
 
 # End of conf.mk
diff --git a/src/ds390/Makefile b/src/ds390/Makefile
deleted file mode 100644 (file)
index 3b85636..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Make all in this directory
-include ../port.mk
diff --git a/src/ds390/Makefile.in b/src/ds390/Makefile.in
new file mode 100644 (file)
index 0000000..dfb8a52
--- /dev/null
@@ -0,0 +1,7 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+# Make all in this directory
+include $(srcdir)/../port.mk
diff --git a/src/ds400/Makefile b/src/ds400/Makefile
deleted file mode 100644 (file)
index 3b85636..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Make all in this directory
-include ../port.mk
diff --git a/src/ds400/Makefile.in b/src/ds400/Makefile.in
new file mode 100644 (file)
index 0000000..dfb8a52
--- /dev/null
@@ -0,0 +1,7 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+# Make all in this directory
+include $(srcdir)/../port.mk
diff --git a/src/hc08/Makefile b/src/hc08/Makefile
deleted file mode 100644 (file)
index 3b85636..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Make all in this directory
-include ../port.mk
diff --git a/src/hc08/Makefile.in b/src/hc08/Makefile.in
new file mode 100644 (file)
index 0000000..dfb8a52
--- /dev/null
@@ -0,0 +1,7 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+# Make all in this directory
+include $(srcdir)/../port.mk
index 3b85636455228667d661cdeb414b93d2c6d9205c..b37db7676194be33be5414843571329d38ad1c29 100644 (file)
@@ -1,2 +1,6 @@
+srcdir       = .
+top_builddir = ../../
+top_srcdir   = ../..
+
 # Make all in this directory
 include ../port.mk
diff --git a/src/mcs51/Makefile b/src/mcs51/Makefile
deleted file mode 100644 (file)
index 3b85636..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Make all in this directory
-include ../port.mk
diff --git a/src/mcs51/Makefile.in b/src/mcs51/Makefile.in
new file mode 100644 (file)
index 0000000..dfb8a52
--- /dev/null
@@ -0,0 +1,7 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+# Make all in this directory
+include $(srcdir)/../port.mk
diff --git a/src/pic/Makefile b/src/pic/Makefile
deleted file mode 100644 (file)
index 6fff46f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# Make all in this directory
-PORT   = pic
-
-include ../port.mk
diff --git a/src/pic/Makefile.in b/src/pic/Makefile.in
new file mode 100644 (file)
index 0000000..8f8d493
--- /dev/null
@@ -0,0 +1,9 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+# Make all in this directory
+PORT   = pic
+
+include $(srcdir)/../port.mk
diff --git a/src/pic16/Makefile b/src/pic16/Makefile
deleted file mode 100644 (file)
index 3b85636..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Make all in this directory
-include ../port.mk
diff --git a/src/pic16/Makefile.in b/src/pic16/Makefile.in
new file mode 100644 (file)
index 0000000..dfb8a52
--- /dev/null
@@ -0,0 +1,7 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+# Make all in this directory
+include $(srcdir)/../port.mk
index 2738b29525a3f08118ea3ea033060ed7ae6e0a91..16cfa6b41d3e6e6662dcb9a59085d6e4a7c567db 100644 (file)
@@ -4,7 +4,7 @@ $Id$
 Current pic16 port status is: Development
 
 Some things may change without notification between port updates. The latest
-CVS snapshot is guarenteed to compile without problems, but does not
+SVN snapshot is guarenteed to compile without problems, but does not
 guarantee backwards compatibility.
 
 For any questions please ask the current port
index a08552235a9b8d7850bc5327a0134fb024d8723d..205d28f5917c741eec1e453e5db5110238cd4f8c 100644 (file)
@@ -2,4 +2,4 @@ clean:
        rm -f $(LIB) *.o *~ port.a *.lst *.asm *.sym *~ *.cdb *.dep *.rul
 
 distclean: clean
-
+       rm -f Makefile
\ No newline at end of file
index 0fcc395cff937a0575676ea811a023dbc04f1f0c..466a2eae0bc40f8152987cbe212a9fd07b322570 100644 (file)
@@ -5,20 +5,20 @@
 #        PREBUILD - list of special files to build before deps.
 
 # Ports are always located in sdcc/src/<portname>
-PRJDIR = ../..
+
 # Output
 LIB = port.a
 # Include the sdcc/src directory
-INCLUDEFLAGS = -I..
+INCLUDEFLAGS = -I$(srcdir)/.. -I..
 
 # If the sources aren't specified, assume all in this directory.
 ifndef SOURCES
-SOURCES = $(wildcard *.c)
+SOURCES = $(notdir $(wildcard $(srcdir)/*.c))
 endif
 
 # If the peephole rules aren't specified, assume all.
 ifndef PEEPRULES
-PEEPDEFS = $(wildcard *.def)
+PEEPDEFS = $(notdir $(wildcard $(srcdir)/*.def))
 PEEPRULES = $(PEEPDEFS:.def=.rul)
 endif
 
@@ -26,7 +26,7 @@ PREBUILD += $(PEEPRULES)
 
 all: $(PREBUILD) dep $(LIB)
 
-include $(PRJDIR)/Makefile.common
+include $(top_builddir)Makefile.common
 
 $(LIB): $(OBJ)
        rm -f $(LIB)
@@ -34,13 +34,16 @@ $(LIB): $(OBJ)
        $(RANLIB) $(LIB)
 
 %.rul: %.def
-       $(AWK) -f ../SDCCpeeph.awk $< > $@
+       $(AWK) -f $(srcdir)/../SDCCpeeph.awk $< > $@
 
 dep: Makefile.dep
 
-Makefile.dep: $(PREBUILD) Makefile $(SOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h $(PRJDIR)/src/*.h
-       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
+Makefile.dep: $(PREBUILD) Makefile $(SOURCES) $(SPECIAL)
+       $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
 
-include Makefile.dep
+# don't include Makefile.dep for the listed targets:
+ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""
+  include Makefile.dep
+endif
 
-include ../port-clean.mk
+include $(srcdir)/../port-clean.mk
diff --git a/src/xa51/Makefile b/src/xa51/Makefile
deleted file mode 100644 (file)
index 3b85636..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Make all in this directory
-include ../port.mk
diff --git a/src/xa51/Makefile.in b/src/xa51/Makefile.in
new file mode 100644 (file)
index 0000000..dfb8a52
--- /dev/null
@@ -0,0 +1,7 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+# Make all in this directory
+include $(srcdir)/../port.mk
diff --git a/src/z80/Makefile b/src/z80/Makefile
deleted file mode 100644 (file)
index 3b85636..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Make all in this directory
-include ../port.mk
diff --git a/src/z80/Makefile.in b/src/z80/Makefile.in
new file mode 100644 (file)
index 0000000..dfb8a52
--- /dev/null
@@ -0,0 +1,7 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+top_srcdir   = @top_srcdir@
+
+# Make all in this directory
+include $(srcdir)/../port.mk
index 44d747a6f1caff05fba08ce001034d2172d58443..90cf7293b2ad0974b2ed8791ed77c3bc2595ba78 100644 (file)
@@ -23,8 +23,9 @@
 #Boston MA 02111-1307, USA.
 
 EXEEXT = @EXEEXT@
-PRJDIR = ../..
-TARGET = $(PRJDIR)/bin/sdcpp$(EXEEXT)
+TARGET = ../../bin/sdcpp$(EXEEXT)
+
+VPATH  = @srcdir@
 
 # This is the default target.
 all: $(TARGET)
@@ -93,7 +94,7 @@ exeext = @host_exeext@
 transform       = @program_transform_name@
 
 # Top build directory, relative to here.
-top_builddir = .
+top_builddir = @top_builddir@
 
 # Whether we were configured with NLS.
 USE_NLS = @USE_NLS@
@@ -119,7 +120,7 @@ clean:
 
 distclean: clean
        -rm -f auto-host.h auto-build.h cstamp-h Makefile
-       -rm -f config.status config.run config.cache config.bak config.log *~
+       -rm -f configargs.h config.status config.run config.cache config.bak config.log *~
 
 # This tells GNU Make version 3 not to put all variables in the environment.
 .NOEXPORT:
@@ -145,7 +146,7 @@ SYSTEM_H = system.h hwint.h
 #@build_overrides@
 #\f
 
-INCLUDES = -I$(srcdir) -I$(LIBIBERTY_DIR)
+INCLUDES = -I$(srcdir) -I$(LIBIBERTY_DIR) -I.
 
 # Always use -I$(srcdir)/config when compiling.
 .c.o:
@@ -223,6 +224,7 @@ MY_LIBIBERTY_BITS = safe-ctype.o obstack.o splay-tree.o \
                    lbasename.o
 
 $(TARGET): cppmain.o intl.o $(MY_LIBIBERTY_BITS) libcpp.a $(LIBDEPS) 
+       mkdir -p $(dir $@)
        $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cppmain.o \
        $(MY_LIBIBERTY_BITS) libcpp.a $(LIBS)
 
index 8ab53b741151e03f1bc1a0f9d4f66be52db439d5..eb3d84a87ac55785449e96e83b18691d029aaf6b 100644 (file)
@@ -1,11 +1,9 @@
-PRJDIR = ../..
-
 # Deleting all files created by building the program
 # --------------------------------------------------
 clean:
        rm -f *core *[%~] *.[oa]
        rm -f .[a-z]*~
-       rm -f $(PRJDIR)/bin/sdcpp$(EXEEXT)
+       rm -f $(top_builddir)bin/sdcpp$(EXEEXT)
 
 
 # Deleting all files created by configuring or building the program
diff --git a/support/librarian/Makefile b/support/librarian/Makefile
deleted file mode 100644 (file)
index 99092d1..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-PRJDIR          = ../..
-
-include $(PRJDIR)/Makefile.common
-
-CFLAGS          += -Wall
-
-OBJECTS        = sdcclib.o
-
-SOURCES                = $(patsubst %.o,%.c,$(OBJECTS))
-
-TARGET         = $(PRJDIR)/bin/sdcclib$(EXEEXT)
-
-all: $(TARGET)
-
-install: all installdirs
-       $(INSTALL) $(TARGET) `echo $(DESTDIR)$(bindir)/sdcclib$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(DESTDIR)$(bindir)/sdcclib$(EXEEXT)|sed '$(transform)'`
-
-# Deleting all the installed files
-# --------------------------------
-uninstall:
-       rm -f $(DESTDIR)$(bindir)/sdcclib$(EXEEXT)
-
-# Performing self-test
-# --------------------
-check:
-
-
-# Performing installation test
-# ----------------------------
-installcheck:
-
-
-# Creating installation directories
-# ---------------------------------
-installdirs:
-       $(INSTALL) -d $(DESTDIR)$(bindir)
-
-
-# Creating dependencies
-# ---------------------
-dep:
-
-$(TARGET): $(OBJECTS)
-       $(CC) $(LDFLAGS) -o $@ $(OBJECTS)
-
-.c.o:
-       $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-
-
-checkconf:
-
-include clean.mk
diff --git a/support/librarian/Makefile.in b/support/librarian/Makefile.in
new file mode 100644 (file)
index 0000000..b646808
--- /dev/null
@@ -0,0 +1,55 @@
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_builddir = @top_builddir@
+
+include $(top_builddir)Makefile.common
+
+CFLAGS          += -Wall
+
+OBJECTS        = sdcclib.o
+
+SOURCES                = $(patsubst %.o,%.c,$(OBJECTS))
+
+TARGET         = $(top_builddir)bin/sdcclib$(EXEEXT)
+
+all: $(TARGET)
+
+install: all installdirs
+       $(INSTALL) $(TARGET) `echo $(DESTDIR)$(bindir)/sdcclib$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/sdcclib$(EXEEXT)|sed '$(transform)'`
+
+# Deleting all the installed files
+# --------------------------------
+uninstall:
+       rm -f $(DESTDIR)$(bindir)/sdcclib$(EXEEXT)
+
+# Performing self-test
+# --------------------
+check:
+
+
+# Performing installation test
+# ----------------------------
+installcheck:
+
+
+# Creating installation directories
+# ---------------------------------
+installdirs:
+       $(INSTALL) -d $(DESTDIR)$(bindir)
+
+
+# Creating dependencies
+# ---------------------
+dep:
+
+$(TARGET): $(OBJECTS)
+       $(CC) $(LDFLAGS) -o $@ $(OBJECTS)
+
+.c.o:
+       $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+
+checkconf:
+
+include $(srcdir)/clean.mk
index 7e2a3ca088241dc6b1415a867cdcf81b1ad6d8af..19bfdf1f82e51a41bfd626504a15e9577e5ddef5 100644 (file)
@@ -1,8 +1,7 @@
-PRJDIR = ../..
-
 clean:
        rm -f *core *[%~] *.[oa] *.output
        rm -f .[a-z]*~ \#*
-       rm -f $(PRJDIR)/bin/sdcclib$(EXEEXT)
+       rm -f $(top_builddir)bin/sdcclib$(EXEEXT)
 
 distclean realclean: clean
+       rm -f Makefile
diff --git a/support/makebin/Makefile b/support/makebin/Makefile
deleted file mode 100644 (file)
index b957b8e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-PRJDIR = ../..
-
-SOURCES = makebin.c
-BIN = $(PRJDIR)/bin/makebin$(EXEEXT)
-
-include $(PRJDIR)/Makefile.common
-
-all: $(BIN)
-
-$(BIN): $(OBJ)
-       $(CC) $(LDFLAGS) -o $(BIN) $(OBJ)
-
-install: all
-       mkdir -p $(DESTDIR)$(bindir)
-       $(INSTALL) $(BIN) `echo $(DESTDIR)$(bindir)/makebin$(EXEEXT)|sed '$(transform)'`
-       $(STRIP) `echo $(DESTDIR)$(bindir)/makebin$(EXEEXT)|sed '$(transform)'`
-
-uninstall:
-       rm -f $(DESTDIR)$(bindir)/makebin$(EXEEXT)
-
-include clean.mk
diff --git a/support/makebin/Makefile.in b/support/makebin/Makefile.in
new file mode 100644 (file)
index 0000000..83f5193
--- /dev/null
@@ -0,0 +1,25 @@
+VPATH  = @srcdir@
+srcdir = @srcdir@
+
+top_builddir = @top_builddir@
+
+SOURCES = makebin.c
+BIN = $(top_builddir)bin/makebin$(EXEEXT)
+
+include $(top_builddir)Makefile.common
+
+all: $(BIN)
+
+$(BIN): $(OBJ)
+       mkdir -p $(top_builddir)bin
+       $(CC) $(LDFLAGS) -o $(BIN) $(OBJ)
+
+install: all
+       mkdir -p $(DESTDIR)$(bindir)
+       $(INSTALL) $(BIN) `echo $(DESTDIR)$(bindir)/makebin$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/makebin$(EXEEXT)|sed '$(transform)'`
+
+uninstall:
+       rm -f $(DESTDIR)$(bindir)/makebin$(EXEEXT)
+
+include $(srcdir)/clean.mk
index dfe9fb2067442abb00bf8eb04de51f1b9591c0b5..715c0ae64940d22bfa00489f94fb9322a87581de 100644 (file)
@@ -1,16 +1,14 @@
 # Deleting all files created by building the program
 # --------------------------------------------------
-PRJDIR = ../..
-
 clean:
        rm -rf obj
-       rm -f *core *[%~] *.[oa] $(PRJDIR)/bin/makebin$(EXEEXT)
+       rm -f *core *[%~] *.[oa] $(top_builddir)bin/makebin$(EXEEXT)
        rm -f *.[a-z]*~
 
 # Deleting all files created by configuring or building the program
 # -----------------------------------------------------------------
 distclean: clean
-       rm -f *.dep
+       rm -f Makefile *.dep
 
 
 # Like clean but some files may still exist
index 98950bce9d990b15edcf03d1a876b5061cc1e7c2..5866ce6f445fd3e51ac11eaf9d5c27baeff43834 100644 (file)
@@ -15,8 +15,8 @@
 # one of the library files should cause all to re-run
 
 # Dependancies:
-#   * The sdcc-extra package, available from Subversion.
-#       o  svn co https://svn.sourceforge.net/svnroot/sdcc/trunk/sdcc-extra sdcc-extra
+#   * The sdcc-extra package, available from svn.
+#       o svn co https://svn.sourceforge.net/svnroot/sdcc/trunk/sdcc-extra
 #       o Provides the emulators
 #   * The gbdk-lib package from gbdk.
 #       o cvs -d cvs.gbdk.sourceforge.net:/cvsroot/gbdk co gbdk-lib
 
 CC = @CC@
 
+# support VPATH:
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_srcdir   = @top_srcdir@
+top_builddir = @top_builddir@
+
 # All original tests live in TESTS_DIR and below
-TESTS_DIR = tests
+TESTS_DIR = $(srcdir)/tests
 TESTS_NAME = $(TESTS_DIR)
 # All suite results go in RESULTS_DIR
 RESULTS_DIR = results
 # All data relating to supported ports live in their own directory
 # under PORTS_DIR.
-PORTS_DIR = ports
+PORTS_DIR = $(srcdir)/ports
 
 # Itermediate data directories
 # Directory that generated cases and the related object code go.
 CASES_DIR = gen
 
 # Script that takes a source test suite and generates the iterations
-GENERATE_CASES = generate-cases.py
+GENERATE_CASES = $(srcdir)/generate-cases.py
 
 # Magically generate the list of configured ports to test.
 # Each directory under ports/ is used as a port name.  Each port is tested.
@@ -136,13 +142,12 @@ PORT_RESULTS_DIR = $(RESULTS_DIR)/$(PORT)
 # Each test generates a result log file
 PORT_RESULTS = $(ALL_TESTS:$(TESTS_DIR)/%.c=$(PORT_RESULTS_DIR)/%.out)
 
-SDCC_DIR = ../..
-SDCC_EXTRA_DIR = ../../../sdcc-extra
-INC_DIR = $(SDCC_DIR)/device/include
+SDCC_EXTRA_DIR = $(top_builddir)../sdcc-extra
+INC_DIR = $(top_srcdir)/device/include
 
 # Defaults.  Override in spec.mk if required.
 # Path to SDCC
-SDCC = $(SDCC_DIR)/bin/sdcc
+SDCC = $(top_builddir)bin/sdcc
 # Base flags.
 SDCCFLAGS +=
 # Extension of object intermediate files
@@ -159,7 +164,7 @@ endif
 
 make_library: $(MAKE_LIBRARY)
 
-SDCCFLAGS += -Ifwk/include -Itests -I$(INC_DIR)
+SDCCFLAGS += -I$(srcdir)/fwk/include -I$(srcdir)/tests -I$(INC_DIR)
 
 # List of intermediate files to keep.  Pretty much keep everything as
 # disk space is free.
@@ -167,21 +172,21 @@ SDCCFLAGS += -Ifwk/include -Itests -I$(INC_DIR)
 
 # Rule to generate the iterations of a test suite off the soure suite.
 $(PORT_CASES_DIR)/%/iterations.stamp: $(TESTS_DIR)/%.c $(GENERATE_CASES)
-       echo Processing $<
-       rm -rf `dirname $@`
-       mkdir -p `dirname $@`
-       python $(GENERATE_CASES) $< `dirname $@` > /dev/null
+       echo Processing $(notdir $<)
+       rm -rf $(dir $@)
+       mkdir -p $(dir $@)
+       python $(GENERATE_CASES) $< $(dir $@) > /dev/null
        touch $@
 
 # Rule linking the combined results log to all of the files in the
 # iteration directory.
 $(PORT_RESULTS_DIR)/%.out: $(PORT_CASES_DIR)/%/iterations.stamp
-       $(MAKE) iterations PORT=$(PORT) CASES=`dirname $<`
+       $(MAKE) iterations PORT=$(PORT) CASES=$(dir $<)
 
 # Rule to summaries the results for one port after all of the tests
 # have been run.
 port-results: port-dirs $(PORT_RESULTS)
-       echo Summary for \'$(PORT)\': `cat $(PORT_RESULTS) | python collate-results.py`
+       echo Summary for \'$(PORT)\': `cat $(PORT_RESULTS) | python $(srcdir)/collate-results.py`
        echo
 
 port-dirs:
@@ -194,11 +199,11 @@ test-port: port-results
 # test
 
 # List of all of the generated iteration source files.
-SUB_CASES = $(sort $(wildcard $(CASES)/*.c))
+SUB_CASES = $(sort $(wildcard $(CASES)*.c))
 # List of all the sub result logs generated from the iterations.
 SUB_RESULTS = $(SUB_CASES:%.c=%.out)
 # Overall target.  Concatenation of all of the sub results.
-RESULTS = $(CASES:$(CASES_DIR)/%$(DIREXT)=$(RESULTS_DIR)/%.out)
+RESULTS = $(CASES:$(CASES_DIR)/%/$(DIREXT)=$(RESULTS_DIR)/%.out)
 
 iterations: $(RESULTS)
 
@@ -206,7 +211,7 @@ iterations: $(RESULTS)
 $(RESULTS): $(SUB_RESULTS)
        cat $(SUB_RESULTS) > $@
 
-# The remainder of the rules are in $PORT/spec.mak.  The port needs to
+# The remainder of the rules are in $PORT/spec.mk.  The port needs to
 # be able to turn an iterated test suite into a sub result, normally
 # by:
 #    1. Compile the required library files
@@ -220,5 +225,8 @@ $(RESULTS): $(SUB_RESULTS)
 # BeginGeneric rules
 
 clean:
-       rm -rf $(CASES_DIR) $(RESULTS_DIR) *.pyc fwk/lib/timeout fwk/lib/timeout.exe
+       rm -rf $(CASES_DIR) $(RESULTS_DIR) *.pyc
        for i in $(CLEAN_PORTS); do $(MAKE) -f $(PORTS_DIR)/$$i/spec.mk _clean PORTS_DIR=$(PORTS_DIR) PORT=$$i; done
+
+distclean: clean
+       rm -f Makefile
index 62de8160d5d7617ccb96bcdf1fb4bb20b859ea26..834d550734aca9bad65a131f5f9f22e282b35aae 100644 (file)
@@ -1,20 +1,20 @@
 # Port specification for the ds390 port running with uCsim
 
 # path to uCsim
-S51A = $(SDCC_DIR)/sim/ucsim/s51.src/s51
-S51B = $(SDCC_DIR)/bin/s51
+S51A = $(top_builddir)sim/ucsim/s51.src/s51
+S51B = $(top_builddir)bin/s51
 
 S51 = $(shell if [ -f $(S51A) ]; then echo $(S51A); else echo $(S51B); fi)
 
-SDCCFLAGS +=-mds390 --nostdinc --less-pedantic -DREENTRANT=reentrant -Wl-r
+SDCCFLAGS +=-mds390 --nostdinc --less-pedantic -DREENTRANT=reentrant -Wl-r -I$(top_srcdir)
 LINKFLAGS = --nostdlib
 LINKFLAGS += libds390.lib libsdcc.lib liblong.lib libint.lib libfloat.lib
-LIBDIR = $(SDCC_DIR)/device/lib/build/ds390
+LIBDIR = $(top_builddir)device/lib/build/ds390
 
 OBJEXT = .rel
 EXEEXT = .ihx
 
-EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
 
 # Rule to link into .ihx
 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
@@ -23,22 +23,21 @@ EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJ
 %$(OBJEXT): %.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-$(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT): fwk/lib/testfwk.c
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
 # run simulator with 25 seconds timeout
-%.out: %$(EXEEXT) fwk/lib/timeout
-       mkdir -p `dirname $@`
-       -fwk/lib/timeout 25 $(S51) -tds390f -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/ds390/uCsim.cmd > $(@:.out=.sim) || \
+%.out: %$(EXEEXT) $(CASES_DIR)/timeout
+       mkdir -p $(dir $@)
+       -$(CASES_DIR)/timeout 25 $(S51) -tds390f -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/ds390/uCsim.cmd > $(@:.out=.sim) || \
           echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
-       python get_ticks.py < $(@:.out=.sim) >> $@
+       python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@
        -grep -n FAIL $@ /dev/null || true
 
-fwk/lib/timeout: fwk/lib/timeout.c
-
+$(CASES_DIR)/timeout: fwk/lib/timeout.c
+       $(CC) $< -o $@
 
 _clean:
-       rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \
-             $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym $(PORTS_DIR)/$(PORT)/*.asm \
-             $(PORTS_DIR)/$(PORT)/*.lnk $(PORTS_DIR)/$(PORT)/*.map $(PORTS_DIR)/$(PORT)/*.mem
-
index ef48258249b054cba364a19fc5273c8c71ee2d36..367a2f56c3568354ac35f3da4c05b14cb1873837 100644 (file)
@@ -5,36 +5,30 @@ EMU = $(SDCC_EXTRA_DIR)/emu/rrgb/rrgb
 SDCCFLAGS +=-mgbz80 --nostdinc --less-pedantic -DREENTRANT=
 LINKFLAGS = --nostdlib
 LINKFLAGS += gbz80.lib
-LIBDIR = $(SDCC_DIR)/device/lib/build/gbz80
+LIBDIR = $(top_builddir)device/lib/build/gbz80
 
 EXEEXT = .gb
 
 # Needs parts of gbdk-lib, namely the internal mul/div/mod functions.
-EXTRAS = ports/$(PORT)/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
 
 # Rule to link into .ihx
 %.gb: %.c $(EXTRAS)
        $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@
 
-%$(OBJEXT): %.asm
-       ../../bin/as-gbz80 -plosgff $@ $<
-
-%$(OBJEXT): %.s
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm
        ../../bin/as-gbz80 -plosgff $@ $<
 
 %$(OBJEXT): %.c
-       echo $(OBJEXT)
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-ports/$(PORT)/%$(OBJEXT): fwk/lib/%.c
+$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
 # PENDING: Path to sdcc-extra
 %.out: %$(EXEEXT)
-       mkdir -p `dirname $@`
+       mkdir -p $(dir $@)
        $(EMU) -k -m $< > $@
        -grep -n FAIL $@ /dev/null || true
 
 _clean:
-       rm -f ports/$(PORT)/testfwk.asm ports/$(PORT)/*.lst ports/$(PORT)/*.o ports/$(PORT)/*.sym
-
index 9cb3f95890a78786e26e884af0701f7835e39f40..113f4c64a90b4d8095461e5c2189c96146daecbf 100644 (file)
@@ -1,18 +1,18 @@
 # path to uCsim
-UCHC08A = $(SDCC_DIR)/sim/ucsim/hc08.src/shc08
-UCHC08B = $(SDCC_DIR)/bin/shc08
+UCHC08A = $(top_builddir)sim/ucsim/hc08.src/shc08
+UCHC08B = $(top_builddir)bin/shc08
 
 UCHC08 = $(shell if [ -f $(UCHC08A) ]; then echo $(UCHC08A); else echo $(UCHC08B); fi)
 
-SDCCFLAGS +=-mhc08 --nostdinc --less-pedantic --out-fmt-ihx -DREENTRANT=reentrant
+SDCCFLAGS +=-mhc08 --nostdinc --less-pedantic --out-fmt-ihx -DREENTRANT=reentrant -I$(top_srcdir)
 LINKFLAGS = --nostdlib
 LINKFLAGS += hc08.lib
-LIBDIR = $(SDCC_DIR)/device/lib/build/hc08
+LIBDIR = $(top_builddir)device/lib/build/hc08
 
 OBJEXT = .rel
 EXEEXT = .ihx
 
-EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
 
 # Rule to link into .ihx
 #%$(EXEEXT): %$(OBJEXT) $(EXTRAS)
@@ -21,24 +21,26 @@ EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJ
        $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@
 
 %$(OBJEXT): %.asm
-       $(SDCC_DIR)/bin/as-hc08 -plosgff $<
+       $(top_builddir)bin/as-hc08 -plosgff $<
 
 %$(OBJEXT): %.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-$(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
 # run simulator with 10 seconds timeout
-%.out: %$(EXEEXT) fwk/lib/timeout
-       mkdir -p `dirname $@`
-       -fwk/lib/timeout 10 $(UCHC08) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
+%.out: %$(EXEEXT) $(CASES_DIR)/timeout
+       mkdir -p $(dir $@)
+       -$(CASES_DIR)/timeout 10 $(UCHC08) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
          || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
-       python get_ticks.py < $@ >> $@
+       python $(srcdir)/get_ticks.py < $@ >> $@
        -grep -n FAIL $@ /dev/null || true
 
-fwk/lib/timeout: fwk/lib/timeout.c
+$(CASES_DIR)/timeout: fwk/lib/timeout.c
+       $(CC) $< -o $@
 
 _clean:
-       rm -f ports/$(PORT)/*.asm ports/$(PORT)/*.lst ports/$(PORT)/*.rel ports/$(PORT)/*.sym
-
index 5d243c81d3c44fe715e5508a2a422020f810f8db..ab3f89f440158466fa155b408a39de0d06bb0520 100644 (file)
@@ -1,19 +1,19 @@
 # Port specification for compiling on the host machines version of gcc
 SDCC = $(shell ( sh -c "gcc --version" 2>&1 ) > /dev/null  && echo gcc || echo cc)
-SDCCFLAGS = -DPORT_HOST=1 -Wall -fsigned-char -fpack-struct -DREENTRANT=
+SDCCFLAGS = -DPORT_HOST=1 -Wall -fsigned-char -fpack-struct -DREENTRANT= -I$(top_builddir) -I$(top_srcdir)
 
 EXEEXT = .bin
 OBJEXT = .o
 INC_DIR = .
 
-# otherwise `make` deletes it and `make -j`will fail
-.PRECIOUS: ports/$(PORT)/testfwk$(OBJEXT)
+# otherwise `make` deletes testfwk.o and `make -j` will fail
+.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT)
 
 # Required extras
-EXTRAS = ports/$(PORT)/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
 
 %.out: %$(EXEEXT)
-       mkdir -p `dirname $@`
+       mkdir -p $(dir $@)
        -$< > $@
        -grep -n FAIL $@ /dev/null || true
 
@@ -23,9 +23,10 @@ EXTRAS = ports/$(PORT)/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
 %$(OBJEXT): %.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-ports/$(PORT)/%$(OBJEXT): fwk/lib/%.c
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-_clean:
-       rm -f ports/$(PORT)/support.o ports/$(PORT)/testfwk$(OBJEXT)
+$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
+_clean:
index 339fb86dcb299606e453b7f2b73da4f2356db7d4..5f958a3486ecd04ff236dd8dce63f66db6e760a1 100644 (file)
@@ -4,10 +4,10 @@
 
 SDCCFLAGS +=--model-large
 
-# copy support.c
-$(PORTS_DIR)/$(PORT)/%.c: $(PORTS_DIR)/mcs51/%.c
-       cp $< $@
-
 include $(PORTS_DIR)/mcs51/spec.mk
 
-LIBDIR = $(SDCC_DIR)/device/lib/build/large
+# use C sources from mcs51
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+LIBDIR = $(top_builddir)device/lib/build/large
index cdc0b0503494dfd0f4eee3958e1a07d74d2d5ef6..c30df57dc14f55cdf961f0243b9cc390b4df60c3 100644 (file)
@@ -4,10 +4,10 @@
 
 SDCCFLAGS +=--model-medium
 
-# copy support.c
-$(PORTS_DIR)/$(PORT)/%.c: $(PORTS_DIR)/mcs51/%.c
-       cp $< $@
-
 include $(PORTS_DIR)/mcs51/spec.mk
 
-LIBDIR = $(SDCC_DIR)/device/lib/build/medium
+# use C sources from mcs51
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+LIBDIR = $(top_builddir)device/lib/build/medium
index f9e2b863b156c494adb5e76898f67ec871e6b193..fe4cdc623014ef7b11409edc58f6e2172aea50e9 100644 (file)
@@ -4,10 +4,10 @@
 
 SDCCFLAGS +=--stack-auto
 
-# copy support.c
-$(PORTS_DIR)/$(PORT)/%.c: $(PORTS_DIR)/mcs51/%.c
-       cp $< $@
-
 include $(PORTS_DIR)/mcs51/spec.mk
 
-LIBDIR = $(SDCC_DIR)/device/lib/build/small-stack-auto
+# use C sources from mcs51
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+LIBDIR = $(top_builddir)device/lib/build/small-stack-auto
index 1b536c9fe69b9ae784d7c77ab639415ec320fc03..2b01fae027eb9e3e8801402f4863aa6c0a7ba357 100644 (file)
@@ -4,15 +4,16 @@
 
 include $(PORTS_DIR)/mcs51/spec.mk
 
-LIBSRCDIR = ../../device/lib
-LIBDIR    = gen/$(PORT)/lib
+LIBSRCDIR   = $(top_srcdir)/device/lib
+LIBBUILDDIR = $(top_builddir)device/lib
+LIBDIR      = $(PORT_CASES_DIR)/lib
 
 LIBSDCCFLAGS+=--std-sdcc99 --stack-auto --xstack
 SDCCFLAGS   +=$(LIBSDCCFLAGS)
 
-# copy support.c
-$(PORTS_DIR)/$(PORT)/%.c: $(PORTS_DIR)/mcs51/%.c
-       cp $< $@
+# use C sources from mcs51
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
 SOURCES = _atoi.c _atol.c _autobaud.c _bp.c _schar2fs.c \
           _decdptr.c _divsint.c _divslong.c _divuint.c \
@@ -52,11 +53,11 @@ $(LIBDIR):
        mkdir -p $(LIBDIR)
 
 $(LIBDIR)/%.rel: $(LIBSRCDIR)/%.c
-       -$(SDCC) -I../../device/include -I../../device/include/mcs51 $(LIBSDCCFLAGS) -c $< -o $@
+       -$(SDCC) -I$(top_srcdir)/device/include -I$(top_srcdir)/device/include/mcs51 $(LIBSDCCFLAGS) -c $< -o $@
 
 .PHONY: lib-files
 lib-files:
-       make -C $(LIBSRCDIR)/mcs51 all
-       cp $(LIBSRCDIR)/mcs51/*.rel $(LIBSRCDIR)/mcs51/mcs51.lib $(LIBDIR)
+       make -C $(LIBBUILDDIR)/mcs51 all
+       cp $(LIBBUILDDIR)/mcs51/*.rel $(LIBBUILDDIR)/mcs51/mcs51.lib $(LIBDIR)
        echo $(MODULES) | tr ' ' '\n' > $(LIBDIR)/libsdcc.lib
        touch $(LIBDIR)/libfloat.lib $(LIBDIR)/libint.lib $(LIBDIR)/liblong.lib
index 6df802ca70f785d101daf2f7a7303fc5930aa3f3..86ec82a267099851a00ea70276dd6741052f0de8 100644 (file)
@@ -3,47 +3,48 @@
 # model small
 
 # path to uCsim
-S51A = $(SDCC_DIR)/sim/ucsim/s51.src/s51
-S51B = $(SDCC_DIR)/bin/s51
+S51A = $(top_builddir)sim/ucsim/s51.src/s51
+S51B = $(top_builddir)bin/s51
 
 S51 = $(shell if [ -f $(S51A) ]; then echo $(S51A); else echo $(S51B); fi)
 
-SDCCFLAGS +=--nostdinc --less-pedantic -DREENTRANT=reentrant -I$(INC_DIR)/mcs51
+SDCCFLAGS +=--nostdinc --less-pedantic -DREENTRANT=reentrant -I$(INC_DIR)/mcs51 -I$(top_srcdir)
 LINKFLAGS = --nostdlib
 LINKFLAGS += mcs51.lib libsdcc.lib liblong.lib libint.lib libfloat.lib
-LIBDIR = $(SDCC_DIR)/device/lib/build/small
+LIBDIR = $(top_builddir)device/lib/build/small
 
 OBJEXT = .rel
 EXEEXT = .ihx
 
-EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
-FWKLIB = $(PORTS_DIR)/$(PORT)/T2_isr$(OBJEXT)
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
+FWKLIB = $(PORT_CASES_DIR)/T2_isr$(OBJEXT)
 
 # Rule to link into .ihx
-%$(EXEEXT): %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORTS_DIR)/$(PORT)/fwk.lib
-       $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $(PORTS_DIR)/$(PORT)/fwk.lib $< -o $@
+%$(EXEEXT): %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib
+       $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@
 
 %$(OBJEXT): %.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-$(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT): fwk/lib/testfwk.c
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-$(PORTS_DIR)/$(PORT)/fwk.lib:
-       cp $(PORTS_DIR)/mcs51/fwk.lib $(PORTS_DIR)/$(PORT)/fwk.lib
+$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/fwk.lib:
+       cp $(PORTS_DIR)/mcs51/fwk.lib $@
 
 # run simulator with 30 seconds timeout
-%.out: %$(EXEEXT) fwk/lib/timeout
-       mkdir -p `dirname $@`
-       -fwk/lib/timeout 30 $(S51) -t32 -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/mcs51/uCsim.cmd > $(@:.out=.sim) \
+%.out: %$(EXEEXT) gen/timeout
+       mkdir -p $(dir $@)
+       -gen/timeout 30 $(S51) -t32 -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/mcs51/uCsim.cmd > $(@:.out=.sim) \
          || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
-       python get_ticks.py < $(@:.out=.sim) >> $@
+       python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@
        -grep -n FAIL $@ /dev/null || true
 
-fwk/lib/timeout: fwk/lib/timeout.c
 
+gen/timeout: $(srcdir)/fwk/lib/timeout.c
+       $(CC) $< -o $@
 
 _clean:
-       rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \
-             $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym $(PORTS_DIR)/$(PORT)/*.asm \
-             $(PORTS_DIR)/$(PORT)/*.lnk $(PORTS_DIR)/$(PORT)/*.map $(PORTS_DIR)/$(PORT)/*.mem
index fa92ec6d0dc2ed7eea4323687d5935d2d0b0cece..288edfefee382b13a7272924dba7f328f95cc94e 100644 (file)
@@ -7,15 +7,15 @@ else
   GPSIM := gpsim
 endif
 
-SDCCFLAGS += -mpic16 -pp18f452 -I$(SDCC_DIR)/device/include/pic16 --nostdinc --less-pedantic -Wl,-t255 -Wl,-q -DREENTRANT=reentrant
+SDCCFLAGS += -mpic16 -pp18f452 -I$(top_srcdir)/device/include/pic16 --nostdinc --less-pedantic -Wl,-t255 -Wl,-q -DREENTRANT=reentrant -I$(top_srcdir)
 LINKFLAGS = --nostdlib
 LINKFLAGS += libsdcc.lib libc18f.lib libm18f.lib
-LIBDIR = $(SDCC_DIR)/device/lib/build/pic16
+LIBDIR = $(top_builddir)device/lib/build/pic16
 
 OBJEXT = .o
 EXEEXT = .cod
 
-EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
 
 # Rule to link into .ihx
 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
@@ -24,20 +24,21 @@ EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJ
 %$(OBJEXT): %.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-$(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT): fwk/lib/testfwk.c
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
 # run simulator with 25 seconds timeout
-%.out: %$(EXEEXT) fwk/lib/timeout
-       mkdir -p `dirname $@`
-       -fwk/lib/timeout 25 $(GPSIM) -i -s $< -c $(PORTS_DIR)/pic16/gpsim.cmd > $@ || \
+%.out: %$(EXEEXT) $(CASES_DIR)/timeout
+       mkdir -p $(dir $@)
+       -$(CASES_DIR)/timeout 25 $(GPSIM) -i -s $< -c $(PORTS_DIR)/pic16/gpsim.cmd > $@ || \
           echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
-       python get_ticks.py < $@ >> $@
+       python $(srcdir)/get_ticks.py < $@ >> $@
        -grep -n FAIL $@ /dev/null || true
 
-fwk/lib/timeout: fwk/lib/timeout.c
+$(CASES_DIR)/timeout: fwk/lib/timeout.c
+       $(CC) $< -o $@
 
 _clean:
-       rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \
-             $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym $(PORTS_DIR)/$(PORT)/*.asm \
-             $(PORTS_DIR)/$(PORT)/*.lnk $(PORTS_DIR)/$(PORT)/*.map $(PORTS_DIR)/$(PORT)/*.mem
index a4f73bc08f3d9f5acdaccc5a11fbc58c3d59e5b9..1ea814a7b5cb260811743cb75cbd3ea94c0fc3b6 100644 (file)
@@ -3,45 +3,47 @@
 
 # path to uCsim
 # path to uCsim
-SZ80A = $(SDCC_DIR)/sim/ucsim/z80.src/sz80
-SZ80B = $(SDCC_DIR)/bin/sz80
+SZ80A = $(top_builddir)sim/ucsim/z80.src/sz80
+SZ80B = $(top_builddir)bin/sz80
 
 UCZ80 = $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi)
 
-SDCCFLAGS +=-mz80 --less-pedantic --profile -DREENTRANT=
+SDCCFLAGS +=-mz80 --less-pedantic --profile -DREENTRANT= -I$(top_srcdir)
 #SDCCFLAGS +=--less-pedantic -DREENTRANT=reentrant
 LINKFLAGS = --nostdlib
 LINKFLAGS += z80.lib
-LIBDIR = $(SDCC_DIR)/device/lib/build/z80
+LIBDIR = $(top_builddir)device/lib/build/z80
 
 #OBJEXT = .o
 EXEEXT = .ihx
 
-EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
 
 # Rule to link into .ihx
 %.ihx: %.c $(EXTRAS)
        $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@
 
-%$(OBJEXT): %.asm
-       $(SDCC_DIR)/bin/as-z80 -plosgff $@ $<
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm
+       $(top_builddir)bin/as-z80 -plosgff $@ $<
 
 %$(OBJEXT): %.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-$(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
 # run simulator with 10 seconds timeout
-%.out: %$(EXEEXT) fwk/lib/timeout
-       mkdir -p `dirname $@`
-       -fwk/lib/timeout 10 $(UCZ80) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
+%.out: %$(EXEEXT) $(CASES_DIR)/timeout
+       mkdir -p $(dir $@)
+       -$(CASES_DIR)/timeout 10 $(UCZ80) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
          || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
-       python get_ticks.py < $@ >> $@
+       python $(srcdir)/get_ticks.py < $@ >> $@
        -grep -n FAIL $@ /dev/null || true
 
-fwk/lib/timeout: fwk/lib/timeout.c
+$(CASES_DIR)/timeout: fwk/lib/timeout.c
+       $(CC) $< -o $@
 
 _clean:
-       rm -f ports/$(PORT)/testfwk.asm ports/$(PORT)/*.lst ports/$(PORT)/*.o ports/$(PORT)/*.sym
-
index 150800c0f9623b977bf55109e480246bc1cefa03..eb50f0195cc1c00a3224624f5c7de83ef74be317 100755 (executable)
@@ -1,41 +1,39 @@
 # Port specification for the xa51 port running with uCsim
 
 # path to uCsim
-SXA_A = $(SDCC_DIR)/sim/ucsim/xa.src/sxa
-SXA_B = $(SDCC_DIR)/bin/sxa
+SXA_A = $(top_builddir)sim/ucsim/xa.src/sxa
+SXA_B = $(top_builddir)bin/sxa
 
 SXA = $(shell if [ -f $(SXA_A) ]; then echo $(SXA_A); else echo $(SXA_B); fi)
 
-SDCCFLAGS +=-mxa51 --less-pedantic -DREENTRANT=
+SDCCFLAGS +=-mxa51 --less-pedantic -DREENTRANT= -I$(top_srcdir)
 
 OBJEXT = .rel
 EXEEXT = .hex
 
-EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
 
 # Rule to link into .hex
 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
        $(SDCC) $(SDCCFLAGS) $(EXTRAS) $< -o $@
-       mv fwk/lib/testfwk.hex $@
-       mv fwk/lib/testfwk.map $(@:.hex=.map)
 
 %$(OBJEXT): %.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-$(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
 # run simulator with 1 second timeout
-%.out: %$(EXEEXT) fwk/lib/timeout
-       mkdir -p `dirname $@`
-       -fwk/lib/timeout 1 $(SXA) -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/xa51/uCsim.cmd >/dev/null || \
+%.out: %$(EXEEXT) $(CASES_DIR)/timeout
+       mkdir -p $(dir $@)
+       -$(CASES_DIR)/timeout 1 $(SXA) -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/xa51/uCsim.cmd >/dev/null || \
           echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@
        -grep -n FAIL $@ /dev/null || true
 
-fwk/lib/timeout: fwk/lib/timeout.c
+$(CASES_DIR)/timeout: fwk/lib/timeout.c
+       $(CC) $< -o $@
 
 _clean:
-       rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \
-             $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym $(PORTS_DIR)/$(PORT)/*.xa $(PORTS_DIR)/$(PORT)/*.lnk
-
-
index 2a568d9d3d8767e24ca8ce18bae2294e24fe99d3..3c0aebd52858e87fa67ee56b3a6abed99d69b060 100644 (file)
@@ -3,42 +3,40 @@
 
 RRZ80 = $(SDCC_EXTRA_DIR)/emu/rrz80/rrz80
 
-SDCCFLAGS +=-mz80 --nostdinc --less-pedantic --profile -DREENTRANT=
+SDCCFLAGS +=-mz80 --nostdinc --less-pedantic --profile -DREENTRANT= -I$(top_srcdir)
 LINKFLAGS = --nostdlib
 LINKFLAGS += z80.lib
-LIBDIR = $(SDCC_DIR)/device/lib/build/z80
+LIBDIR = $(top_builddir)device/lib/build/z80
 
 EXEEXT = .bin
 
 # Needs parts of gbdk-lib, namely the internal mul/div/mod functions.
-EXTRAS = ports/$(PORT)/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
 
 # Rule to generate a Emulator .bin file from the .ihx linker output.
 %$(EXEEXT): %.ihx
-       $(SDCC_DIR)/bin/makebin -s 32768 < $< > $@
+       $(top_builddir)bin/makebin -s 32768 < $< > $@
 
 # Rule to link into .ihx
 %.ihx: %.c $(EXTRAS)
        $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@
 
-%$(OBJEXT): %.asm
-       $(SDCC_DIR)/bin/as-z80 -plosgff $@ $<
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm
+       $(top_builddir)bin/as-z80 -plosgff $@ $<
 
 %$(OBJEXT): %.s
-       $(SDCC_DIR)/bin/as-z80 -plosgff $@ $<
+       $(top_builddir)bin/as-z80 -plosgff $@ $<
 
 %$(OBJEXT): %.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
-ports/$(PORT)/%$(OBJEXT): fwk/lib/%.c
+$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
 
 # PENDING: Path to sdcc-extra
 %.out: %$(EXEEXT)
-       mkdir -p `dirname $@`
+       mkdir -p $(dir $@)
        $(RRZ80) --maxruntime=3 --mapfile=$(<:.bin=.sym) $< > $@
        -grep -n FAIL $@ /dev/null || true
 
 _clean:
-       rm -f ports/$(PORT)/testfwk.asm ports/$(PORT)/*.lst ports/$(PORT)/*.o ports/$(PORT)/*.sym
-
index 8c34a6f46509ba9439f538ab66493995e65fb79e..a469b93af99936c2528ed1042359fff2620f75c1 100644 (file)
@@ -7,19 +7,19 @@
 #define type_{type}
 
 #if defined(PORT_HOST)
-#  include "../../../../../sdccconf.h"
+#  include "sdccconf.h"
 #  define mullong(a,b) mullong_wrapper(a,b)
 #  if defined(type_c) && !defined(WORDS_BIGENDIAN)
 #    define _SDCC_NO_ASM_LIB_FUNCS 1
 #    define near
 #    define long int
-#    include "../../../../../device/lib/_mullong.c"
+#    include "device/lib/_mullong.c"
 #  endif
 #else
 #  if defined(type_c)
 #    define _SDCC_NO_ASM_LIB_FUNCS 1
 #  endif
-#  include "../../../../../device/lib/_mullong.c"
+#  include "device/lib/_mullong.c"
 #  define mullong _mullong
 #endif
 
index d9f8bf7db9b7a1a0da2f72067089f86197b505d6..86e6784dae1f9339cb6ca23daeb6d152f1fc74a3 100755 (executable)
@@ -14,7 +14,7 @@ docdir=/sdcc/doc \
 include_dir_suffix=include \
 lib_dir_suffix=lib \
 sdccconf_h_dir_separator=\\\\ \
---disable-device-lib-build \
+--disable-device-lib \
 --disable-ucsim \
 --host=i586-mingw32msvc --build=unknown-unknown-linux-gnu"
 
diff --git a/support/valdiag/Makefile b/support/valdiag/Makefile
deleted file mode 100644 (file)
index 12c61c1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-.SILENT:
-
-TESTS_DIR = tests
-RESULTS_DIR = results
-PORTS_DIR = ports
-BUILD_DIR = gen
-ALL_PORTS = host mcs51 mcs51-large mcs51-stack-auto ds390 z80 hc08
-
-ALL_TESTS = $(shell find $(TESTS_DIR) -name "*.c")
-
-PORT_RESULTS_DIR = $(RESULTS_DIR)/$(PORT)
-PORT_RESULTS = $(ALL_TESTS:$(TESTS_DIR)/%.c=$(PORT_RESULTS_DIR)/%.out)
-PORT_BUILD_DIR = $(BUILD_DIR)/$(PORT)
-
-all: test-ports
-
-test-ports:
-       for i in $(ALL_PORTS); do $(MAKE) test-port PORT=$$i; done
-
-test-mcs51:
-       $(MAKE) test-port PORT=mcs51
-        
-test-port: port-results
-
-clean: clean-gen
-       rm -rf $(RESULTS_DIR) *.pyc
-       rm -rf $(BUILD_DIR)
-
-clean-gen:     
-       for i in $(ALL_PORTS); do $(MAKE) clean-port PORT=$$i; done
-
-clean-port:
-       rm -rf $(PORT_BUILD_DIR)
-
-$(PORT_RESULTS_DIR)/%.out: $(TESTS_DIR)/%.c
-       echo Processing $<
-       python valdiag.py $(PORT) $< $(PORT_BUILD_DIR)/$* > $@
-
-port-results: port-dirs $(PORT_RESULTS)
-       echo Summary for \'$(PORT)\': `cat $(PORT_RESULTS) | \
-       python ../regression/collate-results.py`
-
-port-dirs:
-       mkdir -p $(PORT_RESULTS_DIR)
-       mkdir -p $(PORT_BUILD_DIR)
diff --git a/support/valdiag/Makefile.in b/support/valdiag/Makefile.in
new file mode 100644 (file)
index 0000000..7b96549
--- /dev/null
@@ -0,0 +1,53 @@
+.SILENT:
+
+VPATH        = @srcdir@
+srcdir       = @srcdir@
+top_srcdir   = @top_srcdir@
+top_builddir = @top_builddir@
+
+TESTS_DIR = $(srcdir)/tests
+RESULTS_DIR = results
+PORTS_DIR = $(srcdir)/ports
+BUILD_DIR = gen
+ALL_PORTS = host mcs51 mcs51-large mcs51-stack-auto ds390 z80 hc08
+
+ALL_TESTS = $(shell find $(TESTS_DIR) -name "*.c")
+
+PORT_RESULTS_DIR = $(RESULTS_DIR)/$(PORT)
+PORT_RESULTS = $(ALL_TESTS:$(TESTS_DIR)/%.c=$(PORT_RESULTS_DIR)/%.out)
+PORT_BUILD_DIR = $(BUILD_DIR)/$(PORT)
+
+all: test-ports
+
+test-ports:
+       for i in $(ALL_PORTS); do $(MAKE) test-port PORT=$$i; done
+
+test-mcs51:
+       $(MAKE) test-port PORT=mcs51
+        
+test-port: port-results
+
+clean: clean-gen
+       rm -rf $(RESULTS_DIR) *.pyc
+       rm -rf $(BUILD_DIR)
+
+distclean: clean
+       rm -r Makefile
+
+clean-gen:     
+       for i in $(ALL_PORTS); do $(MAKE) clean-port PORT=$$i; done
+
+clean-port:
+       rm -rf $(PORT_BUILD_DIR)
+
+$(PORT_RESULTS_DIR)/%.out: $(TESTS_DIR)/%.c
+       echo Processing $<
+       python $(srcdir)/valdiag.py $(PORT) $< $(PORT_BUILD_DIR)/$* > $@
+
+port-results: port-dirs $(PORT_RESULTS)
+       echo Summary for \'$(PORT)\': `cat $(PORT_RESULTS) | \
+       python $(srcdir)/../regression/collate-results.py`
+
+port-dirs:
+       mkdir -p $(PORT_RESULTS_DIR)
+       mkdir -p $(PORT_BUILD_DIR)