From c42e9051755428d14eb620abc9eda86d43479a1a Mon Sep 17 00:00:00 2001 From: bernhardheld Date: Mon, 24 Apr 2006 20:29:10 +0000 Subject: [PATCH] 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 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4121 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 35 + Makefile.common.in | 23 +- Makefile => Makefile.in | 82 +- as/Makefile | 27 - as/Makefile.in | 29 + as/clean.mk | 6 +- as/hc08/Makefile.in | 26 +- as/hc08/clean.mk | 5 +- as/hc08/conf.mk | 4 +- as/mcs51/Makefile.in | 26 +- as/mcs51/clean.mk | 5 +- as/mcs51/conf.mk | 4 +- as/xa51/{Makefile => Makefile.in} | 2 + as/z80/Makefile.in | 119 +- as/z80/clean.mk | 8 +- as/z80/conf.mk | 2 +- clean.mk | 2 +- configure | 1498 +++++++++++------ configure.in | 446 +++-- debugger/mcs51/Makefile.in | 49 +- debugger/mcs51/clean.mk | 5 +- debugger/mcs51/conf.mk | 4 +- device/examples/ds390/test390/Makefile | 2 +- device/include/Makefile.in | 37 +- device/include/conf.mk | 4 +- device/lib/Makefile.in | 116 +- device/lib/clean.mk | 24 +- device/lib/conf.mk | 4 +- device/lib/ds390/{Makefile => Makefile.in} | 13 +- device/lib/ds400/{Makefile => Makefile.in} | 13 +- device/lib/gbz80/{Makefile => Makefile.in} | 6 + device/lib/hc08/{Makefile => Makefile.in} | 6 + device/lib/large/{Makefile => Makefile.in} | 6 +- device/lib/mcs51/Makefile | 31 - device/lib/mcs51/Makefile.in | 40 + device/lib/medium/{Makefile => Makefile.in} | 6 +- device/lib/pic/Makefile.common.in | 12 +- device/lib/pic/{Makefile => Makefile.in} | 21 +- device/lib/pic/Makefile.rules | 32 +- device/lib/pic/Makefile.subdir | 25 +- device/lib/pic/configure | 5 +- device/lib/pic/configure.in | 7 +- device/lib/pic/libsdcc/Makefile | 6 - device/lib/pic/libsdcc/Makefile.in | 10 + device/lib/pic16/Makefile.common.in | 9 +- device/lib/pic16/{Makefile => Makefile.in} | 22 +- device/lib/pic16/Makefile.rules | 30 +- device/lib/pic16/Makefile.subdir | 24 +- device/lib/pic16/configure | 29 +- device/lib/pic16/configure.in | 30 +- device/lib/pic16/debug/Makefile | 6 - device/lib/pic16/debug/Makefile.in | 9 + device/lib/pic16/debug/gstack/Makefile | 5 - device/lib/pic16/debug/gstack/Makefile.in | 9 + device/lib/pic16/libc/Makefile | 6 - device/lib/pic16/libc/Makefile.in | 9 + device/lib/pic16/libc/ctype/Makefile | 5 - device/lib/pic16/libc/ctype/Makefile.in | 8 + device/lib/pic16/libc/delay/Makefile | 6 - device/lib/pic16/libc/delay/Makefile.in | 10 + device/lib/pic16/libc/stdio/Makefile | 6 - device/lib/pic16/libc/stdio/Makefile.in | 10 + device/lib/pic16/libc/stdlib/Makefile | 6 - device/lib/pic16/libc/stdlib/Makefile.in | 10 + device/lib/pic16/libc/string/Makefile | 6 - device/lib/pic16/libc/string/Makefile.in | 10 + device/lib/pic16/libc/utils/Makefile | 6 - device/lib/pic16/libc/utils/Makefile.in | 10 + .../pic16/libdev/{Makefile => Makefile.in} | 15 +- .../lib/pic16/libio/{Makefile => Makefile.in} | 15 +- device/lib/pic16/libio/adc/Makefile | 6 - device/lib/pic16/libio/adc/Makefile.in | 9 + device/lib/pic16/libio/i2c/Makefile | 6 - device/lib/pic16/libio/i2c/Makefile.in | 9 + device/lib/pic16/libio/usart/Makefile | 6 - device/lib/pic16/libio/usart/Makefile.in | 9 + device/lib/pic16/libm/Makefile | 6 - device/lib/pic16/libm/Makefile.in | 9 + device/lib/pic16/libsdcc/Makefile | 7 - device/lib/pic16/libsdcc/Makefile.in | 10 + device/lib/pic16/libsdcc/char/Makefile | 5 - device/lib/pic16/libsdcc/char/Makefile.in | 8 + device/lib/pic16/libsdcc/fixed16x16/Makefile | 5 - .../lib/pic16/libsdcc/fixed16x16/Makefile.in | 8 + device/lib/pic16/libsdcc/float/Makefile | 5 - device/lib/pic16/libsdcc/float/Makefile.in | 8 + device/lib/pic16/libsdcc/gptr/Makefile | 5 - device/lib/pic16/libsdcc/gptr/Makefile.in | 8 + device/lib/pic16/libsdcc/int/Makefile | 5 - device/lib/pic16/libsdcc/int/Makefile.in | 8 + device/lib/pic16/libsdcc/long/Makefile | 5 - device/lib/pic16/libsdcc/long/Makefile.in | 8 + device/lib/pic16/libsdcc/lregs/Makefile | 5 - device/lib/pic16/libsdcc/lregs/Makefile.in | 8 + device/lib/pic16/startup/Makefile | 6 - device/lib/pic16/startup/Makefile.in | 9 + device/lib/small/{Makefile => Makefile.in} | 6 +- device/lib/z80/{Makefile => Makefile.in} | 6 + doc/Makefile | 122 -- doc/Makefile.in | 135 ++ doc/clean.mk | 5 +- doc/sdccman.lyx | 148 +- link/Makefile | 19 - link/Makefile.in | 21 + link/clean.mk | 4 +- link/z80/Makefile.in | 121 +- link/z80/clean.mk | 9 +- link/z80/conf.mk | 2 +- main_in.mk | 2 +- packihx/Makefile.in | 9 +- packihx/clean.mk | 4 +- sim/ucsim/{Makefile => Makefile.in} | 44 +- sim/ucsim/avr.src/Makefile.in | 37 +- sim/ucsim/avr.src/conf.mk | 4 +- sim/ucsim/clean.mk | 2 +- sim/ucsim/cmd.src/Makefile.in | 24 +- sim/ucsim/cmd.src/conf.mk | 4 +- sim/ucsim/configure | 425 +++-- sim/ucsim/configure.in | 55 +- sim/ucsim/doc/Makefile.in | 18 +- sim/ucsim/doc/conf.mk | 4 +- sim/ucsim/gui.src/Makefile.in | 51 +- sim/ucsim/gui.src/clean.mk | 8 +- sim/ucsim/gui.src/conf.mk | 4 +- .../gui.src/obsolete/portmon.src/Makefile.in | 21 +- .../gui.src/obsolete/portmon.src/conf.mk | 4 +- sim/ucsim/gui.src/serio.src/Makefile.in | 23 +- sim/ucsim/gui.src/serio.src/conf.mk | 4 +- sim/ucsim/hc08.src/Makefile.in | 37 +- sim/ucsim/hc08.src/conf.mk | 4 +- sim/ucsim/libltdl/Makefile.in | 6 +- sim/ucsim/main_in.mk | 23 +- sim/ucsim/packages_in.mk | 2 + sim/ucsim/s51.src/Makefile.in | 39 +- sim/ucsim/s51.src/conf.mk | 4 +- sim/ucsim/sim.src/Makefile.in | 26 +- sim/ucsim/sim.src/conf.mk | 4 +- sim/ucsim/xa.src/Makefile.in | 27 +- sim/ucsim/xa.src/conf.mk | 4 +- sim/ucsim/z80.src/Makefile.in | 37 +- sim/ucsim/z80.src/conf.mk | 4 +- src/Makefile.in | 36 +- src/avr/Makefile | 2 - src/avr/Makefile.in | 7 + src/clean.mk | 14 +- src/conf.mk | 4 +- src/ds390/Makefile | 2 - src/ds390/Makefile.in | 7 + src/ds400/Makefile | 2 - src/ds400/Makefile.in | 7 + src/hc08/Makefile | 2 - src/hc08/Makefile.in | 7 + src/izt/Makefile | 4 + src/mcs51/Makefile | 2 - src/mcs51/Makefile.in | 7 + src/pic/Makefile | 4 - src/pic/Makefile.in | 9 + src/pic16/Makefile | 2 - src/pic16/Makefile.in | 7 + src/pic16/NOTES | 2 +- src/port-clean.mk | 2 +- src/port.mk | 23 +- src/xa51/Makefile | 2 - src/xa51/Makefile.in | 7 + src/z80/Makefile | 2 - src/z80/Makefile.in | 7 + support/cpp2/Makefile.in | 12 +- support/cpp2/clean.mk | 4 +- support/librarian/{Makefile => Makefile.in} | 10 +- support/librarian/clean.mk | 5 +- support/makebin/{Makefile => Makefile.in} | 12 +- support/makebin/clean.mk | 6 +- support/regression/Makefile.in | 48 +- support/regression/ports/ds390/spec.mk | 31 +- support/regression/ports/gbz80/spec.mk | 16 +- support/regression/ports/hc08/spec.mk | 30 +- support/regression/ports/host/spec.mk | 17 +- support/regression/ports/mcs51-large/spec.mk | 10 +- support/regression/ports/mcs51-medium/spec.mk | 10 +- .../regression/ports/mcs51-stack-auto/spec.mk | 10 +- .../ports/mcs51-xstack-auto/spec.mk | 17 +- support/regression/ports/mcs51/spec.mk | 39 +- support/regression/ports/pic16/spec.mk | 25 +- support/regression/ports/ucz80/spec.mk | 32 +- support/regression/ports/xa51/spec.mk | 28 +- support/regression/ports/z80/spec.mk | 20 +- support/regression/tests/libmullong.c | 6 +- support/scripts/sdcc_mingw32 | 2 +- support/valdiag/{Makefile => Makefile.in} | 16 +- 189 files changed, 3371 insertions(+), 2094 deletions(-) rename Makefile => Makefile.in (70%) delete mode 100644 as/Makefile create mode 100644 as/Makefile.in rename as/xa51/{Makefile => Makefile.in} (97%) rename device/lib/ds390/{Makefile => Makefile.in} (79%) rename device/lib/ds400/{Makefile => Makefile.in} (78%) rename device/lib/gbz80/{Makefile => Makefile.in} (87%) rename device/lib/hc08/{Makefile => Makefile.in} (87%) rename device/lib/large/{Makefile => Makefile.in} (65%) delete mode 100644 device/lib/mcs51/Makefile create mode 100644 device/lib/mcs51/Makefile.in rename device/lib/medium/{Makefile => Makefile.in} (65%) rename device/lib/pic/{Makefile => Makefile.in} (67%) delete mode 100644 device/lib/pic/libsdcc/Makefile create mode 100644 device/lib/pic/libsdcc/Makefile.in rename device/lib/pic16/{Makefile => Makefile.in} (66%) delete mode 100644 device/lib/pic16/debug/Makefile create mode 100644 device/lib/pic16/debug/Makefile.in delete mode 100644 device/lib/pic16/debug/gstack/Makefile create mode 100644 device/lib/pic16/debug/gstack/Makefile.in delete mode 100644 device/lib/pic16/libc/Makefile create mode 100644 device/lib/pic16/libc/Makefile.in delete mode 100644 device/lib/pic16/libc/ctype/Makefile create mode 100644 device/lib/pic16/libc/ctype/Makefile.in delete mode 100644 device/lib/pic16/libc/delay/Makefile create mode 100644 device/lib/pic16/libc/delay/Makefile.in delete mode 100644 device/lib/pic16/libc/stdio/Makefile create mode 100644 device/lib/pic16/libc/stdio/Makefile.in delete mode 100644 device/lib/pic16/libc/stdlib/Makefile create mode 100644 device/lib/pic16/libc/stdlib/Makefile.in delete mode 100644 device/lib/pic16/libc/string/Makefile create mode 100644 device/lib/pic16/libc/string/Makefile.in delete mode 100644 device/lib/pic16/libc/utils/Makefile create mode 100644 device/lib/pic16/libc/utils/Makefile.in rename device/lib/pic16/libdev/{Makefile => Makefile.in} (61%) rename device/lib/pic16/libio/{Makefile => Makefile.in} (78%) delete mode 100644 device/lib/pic16/libio/adc/Makefile create mode 100644 device/lib/pic16/libio/adc/Makefile.in delete mode 100644 device/lib/pic16/libio/i2c/Makefile create mode 100644 device/lib/pic16/libio/i2c/Makefile.in delete mode 100644 device/lib/pic16/libio/usart/Makefile create mode 100644 device/lib/pic16/libio/usart/Makefile.in delete mode 100644 device/lib/pic16/libm/Makefile create mode 100644 device/lib/pic16/libm/Makefile.in delete mode 100644 device/lib/pic16/libsdcc/Makefile create mode 100644 device/lib/pic16/libsdcc/Makefile.in delete mode 100644 device/lib/pic16/libsdcc/char/Makefile create mode 100644 device/lib/pic16/libsdcc/char/Makefile.in delete mode 100644 device/lib/pic16/libsdcc/fixed16x16/Makefile create mode 100644 device/lib/pic16/libsdcc/fixed16x16/Makefile.in delete mode 100644 device/lib/pic16/libsdcc/float/Makefile create mode 100644 device/lib/pic16/libsdcc/float/Makefile.in delete mode 100644 device/lib/pic16/libsdcc/gptr/Makefile create mode 100644 device/lib/pic16/libsdcc/gptr/Makefile.in delete mode 100644 device/lib/pic16/libsdcc/int/Makefile create mode 100644 device/lib/pic16/libsdcc/int/Makefile.in delete mode 100644 device/lib/pic16/libsdcc/long/Makefile create mode 100644 device/lib/pic16/libsdcc/long/Makefile.in delete mode 100644 device/lib/pic16/libsdcc/lregs/Makefile create mode 100644 device/lib/pic16/libsdcc/lregs/Makefile.in delete mode 100644 device/lib/pic16/startup/Makefile create mode 100644 device/lib/pic16/startup/Makefile.in rename device/lib/small/{Makefile => Makefile.in} (65%) rename device/lib/z80/{Makefile => Makefile.in} (87%) delete mode 100644 doc/Makefile create mode 100644 doc/Makefile.in delete mode 100644 link/Makefile create mode 100644 link/Makefile.in rename sim/ucsim/{Makefile => Makefile.in} (75%) delete mode 100644 src/avr/Makefile create mode 100644 src/avr/Makefile.in delete mode 100644 src/ds390/Makefile create mode 100644 src/ds390/Makefile.in delete mode 100644 src/ds400/Makefile create mode 100644 src/ds400/Makefile.in delete mode 100644 src/hc08/Makefile create mode 100644 src/hc08/Makefile.in delete mode 100644 src/mcs51/Makefile create mode 100644 src/mcs51/Makefile.in delete mode 100644 src/pic/Makefile create mode 100644 src/pic/Makefile.in delete mode 100644 src/pic16/Makefile create mode 100644 src/pic16/Makefile.in delete mode 100644 src/xa51/Makefile create mode 100644 src/xa51/Makefile.in delete mode 100644 src/z80/Makefile create mode 100644 src/z80/Makefile.in rename support/librarian/{Makefile => Makefile.in} (81%) rename support/makebin/{Makefile => Makefile.in} (62%) rename support/valdiag/{Makefile => Makefile.in} (74%) diff --git a/ChangeLog b/ChangeLog index 3284909e..caa9dae5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,38 @@ +2006-04-24 Bernhard Held + + 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 * src/pic/device.c (pic14_assignConfigWordValue): remember assignments to diff --git a/Makefile.common.in b/Makefile.common.in index ea00cf7f..5f73360c 100644 --- a/Makefile.common.in +++ b/Makefile.common.in @@ -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 b/Makefile.in similarity index 70% rename from Makefile rename to Makefile.in index c0917729..8942a698 100644 --- a/Makefile +++ b/Makefile.in @@ -4,42 +4,63 @@ SHELL = /bin/sh -PRJDIR = . +VPATH = @srcdir@ +srcdir = @srcdir@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ -include $(PRJDIR)/Makefile.common +include Makefile.common -SDCC_MISC = debugger/mcs51 sim/ucsim -SDCC_LIBS = support/cpp2 support/makebin +SDCC_LIBS = 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 +ifeq ($(OPT_DISABLE_HC08), 0) +SDCC_ASLINK += as/hc08 +endif + +ifeq ($(OPT_DISABLE_MCS51), 0) +SDCC_ASLINK += as/mcs51 +SDCC_MISC += debugger/mcs51 +endif -PKGS = $(SDCC_LIBS) src $(SDCC_ASLINK) $(SDCC_DOC) +ifeq ($(OPT_DISABLE_Z80), 0) +SDCC_ASLINK += as link +endif -ifneq ($(OPT_ENABLE_UCSIM), no) -TARGETS += sdcc-misc +ifeq ($(OPT_DISABLE_UCSIM), 0) +TARGETS += sdcc-misc +SDCC_MISC += sim/ucsim PKGS += $(SDCC_MISC) endif -ifneq ($(OPT_ENABLE_DEVICE_LIB_BUILD), no) -TARGETS += sdcc-device -PKGS += device/include device/lib +ifeq ($(OPT_DISABLE_DEVICE_LIB), 0) +TARGETS += sdcc-device-lib +PKGS += device/lib endif -ifneq ($(OPT_ENABLE_PACKIHX), no) +ifeq ($(OPT_DISABLE_PACKIHX), 0) TARGETS += sdcc-packihx PKGS += $(SDCC_PACKIHX) endif -TARGETS += sdcc-librarian -PKGS += $(SDCC_LIBRARIAN) +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) @@ -59,10 +80,10 @@ sdcc-cc: sdcc-libs $(MAKE) -C src sdcc-aslink: - for as in $(SDCC_ASLINK); do $(MAKE) -C $$as; done + for as in $(SDCC_ASLINK); do $(MAKE) -C $$as ; done sdcc-misc: - for misc in $(SDCC_MISC); do $(MAKE) -C $$misc; done + for misc in $(SDCC_MISC); do $(MAKE) -C $$misc ; done sdcc-packihx: $(MAKE) -C $(SDCC_PACKIHX) @@ -70,16 +91,19 @@ sdcc-packihx: sdcc-librarian: $(MAKE) -C $(SDCC_LIBRARIAN) -sdcc-device: sdcc-cc sdcc-aslink +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 -# Empty for now, as doc depends on latex and latex2html +# doc depends on latex and latex2html sdcc-doc: + $(MAKE) -C doc sdcc: $(TARGETS) @@ -121,31 +145,31 @@ uninstall: # -------------------------------------------------- clean: @echo "+ Cleaning root of the project..." - $(MAKE) -f clean.mk clean + $(MAKE) -f $(srcdir)/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 ;\ + $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) 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 ;\ + $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) distclean ;\ done for pkg in $(SDCC_EXTRA); do \ - $(MAKE) -C $$pkg clean; \ + $(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 clean.mk mostlyclean + $(MAKE) -f $(srcdir)/clean.mk mostlyclean for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" EXEEXT=$(EXEEXT) mostlyclean ;\ + $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) mostlyclean ;\ done @@ -153,9 +177,9 @@ mostlyclean: clean # everything deleted by distclean plus files created by bison, stc. # ----------------------------------------------------------------------- realclean: distclean - $(MAKE) -f clean.mk realclean + $(MAKE) -f $(srcdir)/clean.mk realclean for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" EXEEXT=$(EXEEXT) realclean ;\ + $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) realclean ;\ done diff --git a/as/Makefile b/as/Makefile deleted file mode 100644 index a2b8623f..00000000 --- a/as/Makefile +++ /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 index 00000000..74dbf20e --- /dev/null +++ b/as/Makefile.in @@ -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 diff --git a/as/clean.mk b/as/clean.mk index 55d0fc80..ee9489db 100644 --- a/as/clean.mk +++ b/as/clean.mk @@ -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 diff --git a/as/hc08/Makefile.in b/as/hc08/Makefile.in index 675a6f84..799da3d3 100644 --- a/as/hc08/Makefile.in +++ b/as/hc08/Makefile.in @@ -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 diff --git a/as/hc08/clean.mk b/as/hc08/clean.mk index 27e35fa6..6b47bf1c 100644 --- a/as/hc08/clean.mk +++ b/as/hc08/clean.mk @@ -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 diff --git a/as/hc08/conf.mk b/as/hc08/conf.mk index 879e9bc8..ac65f24e 100644 --- a/as/hc08/conf.mk +++ b/as/hc08/conf.mk @@ -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/as/mcs51/Makefile.in b/as/mcs51/Makefile.in index 7b0a204d..3511edcb 100644 --- a/as/mcs51/Makefile.in +++ b/as/mcs51/Makefile.in @@ -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 diff --git a/as/mcs51/clean.mk b/as/mcs51/clean.mk index a4478815..829d0694 100644 --- a/as/mcs51/clean.mk +++ b/as/mcs51/clean.mk @@ -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 diff --git a/as/mcs51/conf.mk b/as/mcs51/conf.mk index 879e9bc8..e0e34319 100644 --- a/as/mcs51/conf.mk +++ b/as/mcs51/conf.mk @@ -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.in similarity index 97% rename from as/xa51/Makefile rename to as/xa51/Makefile.in index 46d78834..87c4756c 100644 --- a/as/xa51/Makefile +++ b/as/xa51/Makefile.in @@ -1,3 +1,5 @@ +VPATH = @srcdir@ + CC = gcc CFLAGS = -ggdb -Wall YACC = bison -y -d diff --git a/as/z80/Makefile.in b/as/z80/Makefile.in index 50d70bef..56c788f8 100644 --- a/as/z80/Makefile.in +++ b/as/z80/Makefile.in @@ -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 diff --git a/as/z80/clean.mk b/as/z80/clean.mk index cf18deed..579a48e5 100644 --- a/as/z80/clean.mk +++ b/as/z80/clean.mk @@ -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 diff --git a/as/z80/conf.mk b/as/z80/conf.mk index 524efe65..e677a9c2 100644 --- a/as/z80/conf.mk +++ b/as/z80/conf.mk @@ -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 diff --git a/clean.mk b/clean.mk index 6ccdb05b..bd9f607d 100644 --- 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 diff --git a/configure b/configure index a2ae07d3..0f73bad4 100755 --- 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 @@ -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} + path(argv[0])${libPath2}${dirch} + ${libPath3}${dirch} +" >&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} + path(argv[0])${libPath2}${dirch} + ${libPath3}${dirch} +" >&6 # End of configure/configure.in diff --git a/configure.in b/configure.in index fdea578b..eeb265dc 100755 --- a/configure.in +++ b/configure.in @@ -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 < @@ -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} + path(argv[[0]])${libPath2}${dirch} + ${libPath3}${dirch} +]) # End of configure/configure.in diff --git a/debugger/mcs51/Makefile.in b/debugger/mcs51/Makefile.in index 9a6c9fc0..7a2af2f3 100644 --- a/debugger/mcs51/Makefile.in +++ b/debugger/mcs51/Makefile.in @@ -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 diff --git a/debugger/mcs51/clean.mk b/debugger/mcs51/clean.mk index 6c54d98c..5f3f6637 100644 --- a/debugger/mcs51/clean.mk +++ b/debugger/mcs51/clean.mk @@ -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 # ----------------------------------------------------------------- diff --git a/debugger/mcs51/conf.mk b/debugger/mcs51/conf.mk index 879e9bc8..ac65f24e 100644 --- a/debugger/mcs51/conf.mk +++ b/debugger/mcs51/conf.mk @@ -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/examples/ds390/test390/Makefile b/device/examples/ds390/test390/Makefile index 4abdeead..3d54c0b8 100644 --- a/device/examples/ds390/test390/Makefile +++ b/device/examples/ds390/test390/Makefile @@ -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 diff --git a/device/include/Makefile.in b/device/include/Makefile.in index 70fb7a66..71192087 100644 --- a/device/include/Makefile.in +++ b/device/include/Makefile.in @@ -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 diff --git a/device/include/conf.mk b/device/include/conf.mk index 879e9bc8..ac65f24e 100644 --- a/device/include/conf.mk +++ b/device/include/conf.mk @@ -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/Makefile.in b/device/lib/Makefile.in index 424d841f..ca53e713 100644 --- a/device/lib/Makefile.in +++ b/device/lib/Makefile.in @@ -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 diff --git a/device/lib/clean.mk b/device/lib/clean.mk index 12c8e4c8..2f0867b0 100644 --- a/device/lib/clean.mk +++ b/device/lib/clean.mk @@ -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 # ----------------------------------------- diff --git a/device/lib/conf.mk b/device/lib/conf.mk index 879e9bc8..ac65f24e 100644 --- a/device/lib/conf.mk +++ b/device/lib/conf.mk @@ -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.in similarity index 79% rename from device/lib/ds390/Makefile rename to device/lib/ds390/Makefile.in index 1f23e4b5..e5ab78ca 100755 --- a/device/lib/ds390/Makefile +++ b/device/lib/ds390/Makefile.in @@ -1,3 +1,6 @@ +VPATH = @srcdir@ +srcdir = @srcdir@ + CC = ../../../bin/sdcc #VERBOSE = --verbose @@ -15,8 +18,8 @@ clean: rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex rm -f *.ihx temp.lnk *.map *.lib -superclean: - make clean ; rm Makefile.dep +distclean: clean + rm -f Makefile Makefile.dep libds390.lib: $(OBJECTS) rm -f $@; \ @@ -33,10 +36,12 @@ depend: Makefile.dep Makefile.dep: $(SOURCES) rm -f Makefile.dep - for i in $(SOURCES); do \ + for i in $^; do \ $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \ cat $${i}.dep >>Makefile.dep; \ rm $${i}.dep; \ done -include Makefile.dep +ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" "" + include Makefile.dep +endif diff --git a/device/lib/ds400/Makefile b/device/lib/ds400/Makefile.in similarity index 78% rename from device/lib/ds400/Makefile rename to device/lib/ds400/Makefile.in index 7925d036..c1e3752c 100755 --- a/device/lib/ds400/Makefile +++ b/device/lib/ds400/Makefile.in @@ -1,5 +1,8 @@ CC = ../../../bin/sdcc +VPATH = @srcdir@ +srcdir = @srcdir@ + #VERBOSE = --verbose OBJECTS = tinibios.rel memcpyx.rel ds400rom.rel @@ -15,8 +18,8 @@ clean: rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex rm -f *.ihx temp.lnk *.map *.lib -superclean: - make clean ; rm Makefile.dep +distclean: clean + rm -f Makefile Makefile.dep libds400.lib: $(OBJECTS) rm -f $@; \ @@ -33,10 +36,12 @@ depend: Makefile.dep Makefile.dep: $(SOURCES) rm -f Makefile.dep - for i in $(SOURCES); do \ + for i in $^; do \ $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \ cat $${i}.dep >>Makefile.dep; \ rm $${i}.dep; \ done -include Makefile.dep +ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" "" + include Makefile.dep +endif diff --git a/device/lib/gbz80/Makefile b/device/lib/gbz80/Makefile.in similarity index 87% rename from device/lib/gbz80/Makefile rename to device/lib/gbz80/Makefile.in index e41c61f2..39d65de3 100644 --- a/device/lib/gbz80/Makefile +++ b/device/lib/gbz80/Makefile.in @@ -1,5 +1,8 @@ # libc/z80 Makefile +VPATH = @srcdir@ +srcdir = @srcdir@ + TOPDIR = ../../.. SCC = $(TOPDIR)/bin/sdcc -mgbz80 @@ -25,3 +28,6 @@ _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.in similarity index 87% rename from device/lib/hc08/Makefile rename to device/lib/hc08/Makefile.in index baded10f..844b120e 100644 --- a/device/lib/hc08/Makefile +++ b/device/lib/hc08/Makefile.in @@ -1,5 +1,8 @@ # libc/hc08 Makefile +VPATH = @srcdir@ +srcdir = @srcdir@ + TOPDIR = ../../.. SCC = $(TOPDIR)/bin/sdcc -mhc08 @@ -30,3 +33,6 @@ _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.in similarity index 65% rename from device/lib/large/Makefile rename to device/lib/large/Makefile.in index b576379c..4acca3f0 100644 --- a/device/lib/large/Makefile +++ b/device/lib/large/Makefile.in @@ -1,4 +1,3 @@ -# Dummy Makefile to get around Subversion all: $(MAKE) -C ../mcs51 all cp ../mcs51/*.rel ../mcs51/*.lib . @@ -6,4 +5,7 @@ all: touch dummy.rel clean: - rm *.rel *.lib + 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 index f0c2e6c7..00000000 --- a/device/lib/mcs51/Makefile +++ /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 index 00000000..29ce7c00 --- /dev/null +++ b/device/lib/mcs51/Makefile.in @@ -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.in similarity index 65% rename from device/lib/medium/Makefile rename to device/lib/medium/Makefile.in index b576379c..4acca3f0 100644 --- a/device/lib/medium/Makefile +++ b/device/lib/medium/Makefile.in @@ -1,4 +1,3 @@ -# Dummy Makefile to get around Subversion all: $(MAKE) -C ../mcs51 all cp ../mcs51/*.rel ../mcs51/*.lib . @@ -6,4 +5,7 @@ all: touch dummy.rel clean: - rm *.rel *.lib + rm -f *.rel *.lib + +distclean: clean + rm -f Makefile \ No newline at end of file diff --git a/device/lib/pic/Makefile.common.in b/device/lib/pic/Makefile.common.in index 1ba999ea..537a44e0 100644 --- a/device/lib/pic/Makefile.common.in +++ b/device/lib/pic/Makefile.common.in @@ -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 b/device/lib/pic/Makefile.in similarity index 67% rename from device/lib/pic/Makefile rename to device/lib/pic/Makefile.in index 2493bae8..6eebdffb 100644 --- a/device/lib/pic/Makefile +++ b/device/lib/pic/Makefile.in @@ -12,9 +12,13 @@ ### $Id$ ### -topsrcdir = . +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ -include $(topsrcdir)/Makefile.common +VPATH = @srcdir@ +srcdir = @srcdir@ + +include $(top_builddir)Makefile.common ifeq (:,$(findstring :,$(LD) $(AS) $(LIB))) @@ -25,13 +29,13 @@ all % : else -SUBDIRS = libsdcc libdev +SUBDIRS = libsdcc builddir = build installdir = bin export installdir -C_SRC = $(wildcard *.c) -S_SRC = $(wildcard *.S) +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 @@ -41,10 +45,13 @@ all : install install : recurse clean : recurse - $(Q)-$(RMDIR) "$(topsrcdir)/$(builddir)"; + $(Q)-$(RMDIR) "$(top_builddir)$(builddir)" + +distclean: clean + rm -f Makefile clean-intermediate : recurse -include $(topsrcdir)/Makefile.rules +include $(top_srcdir)/Makefile.rules endif diff --git a/device/lib/pic/Makefile.rules b/device/lib/pic/Makefile.rules index 452bb278..a7d2fbb2 100644 --- a/device/lib/pic/Makefile.rules +++ b/device/lib/pic/Makefile.rules @@ -13,41 +13,41 @@ ### # 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 diff --git a/device/lib/pic/Makefile.subdir b/device/lib/pic/Makefile.subdir index 1d228e37..f771dc06 100644 --- a/device/lib/pic/Makefile.subdir +++ b/device/lib/pic/Makefile.subdir @@ -12,21 +12,22 @@ ### $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 diff --git a/device/lib/pic/configure b/device/lib/pic/configure index 483cd92e..ec95ff66 100755 --- a/device/lib/pic/configure +++ b/device/lib/pic/configure @@ -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; }; };; diff --git a/device/lib/pic/configure.in b/device/lib/pic/configure.in index f0928a23..1f7ecf4f 100644 --- a/device/lib/pic/configure.in +++ b/device/lib/pic/configure.in @@ -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 index 84b16390..00000000 --- a/device/lib/pic/libsdcc/Makefile +++ /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 index 00000000..415ab189 --- /dev/null +++ b/device/lib/pic/libsdcc/Makefile.in @@ -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.common.in b/device/lib/pic16/Makefile.common.in index 294ebd74..151b4b49 100644 --- a/device/lib/pic16/Makefile.common.in +++ b/device/lib/pic16/Makefile.common.in @@ -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 b/device/lib/pic16/Makefile.in similarity index 66% rename from device/lib/pic16/Makefile rename to device/lib/pic16/Makefile.in index 002ef2a6..de72a4ff 100644 --- a/device/lib/pic16/Makefile +++ b/device/lib/pic16/Makefile.in @@ -16,9 +16,14 @@ ### $Id$ ### -topsrcdir = . +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ -include $(topsrcdir)/Makefile.common +top_pic16builddir = . + +include $(top_pic16builddir)/Makefile.common ifeq (:,$(findstring :,$(LD) $(AS) $(LIB))) @@ -34,21 +39,24 @@ builddir = build installdir = bin export installdir -C_SRC = $(wildcard *.c) -S_SRC = $(wildcard *.S) +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 +.PHONY : all clean distclean clean-intermediate install all : install install : recurse clean : recurse - $(Q)-$(RMDIR) "$(topsrcdir)/$(builddir)"; + $(Q)-$(RMDIR) "$(top_pic16builddir)/$(builddir)" + +distclean: clean + $(RM) -f Makefile clean-intermediate : recurse -include $(topsrcdir)/Makefile.rules +include $(top_srcdir)/Makefile.rules endif diff --git a/device/lib/pic16/Makefile.rules b/device/lib/pic16/Makefile.rules index 81e92e25..f3058419 100644 --- a/device/lib/pic16/Makefile.rules +++ b/device/lib/pic16/Makefile.rules @@ -17,39 +17,39 @@ ### # 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 diff --git a/device/lib/pic16/Makefile.subdir b/device/lib/pic16/Makefile.subdir index 102973be..63952b1d 100644 --- a/device/lib/pic16/Makefile.subdir +++ b/device/lib/pic16/Makefile.subdir @@ -16,21 +16,21 @@ ### $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 diff --git a/device/lib/pic16/configure b/device/lib/pic16/configure index cfd0e023..4e955839 100755 --- a/device/lib/pic16/configure +++ b/device/lib/pic16/configure @@ -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; }; };; diff --git a/device/lib/pic16/configure.in b/device/lib/pic16/configure.in index ac9b28eb..d08d9e37 100644 --- a/device/lib/pic16/configure.in +++ b/device/lib/pic16/configure.in @@ -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 index ce9d253b..00000000 --- a/device/lib/pic16/debug/Makefile +++ /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 index 00000000..8736f338 --- /dev/null +++ b/device/lib/pic16/debug/Makefile.in @@ -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 index 87adf7fc..00000000 --- a/device/lib/pic16/debug/gstack/Makefile +++ /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 index 00000000..02e8d0d4 --- /dev/null +++ b/device/lib/pic16/debug/gstack/Makefile.in @@ -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 index 29f0da76..00000000 --- a/device/lib/pic16/libc/Makefile +++ /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 index 00000000..356bad69 --- /dev/null +++ b/device/lib/pic16/libc/Makefile.in @@ -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 index c682cda9..00000000 --- a/device/lib/pic16/libc/ctype/Makefile +++ /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 index 00000000..e2ea5f92 --- /dev/null +++ b/device/lib/pic16/libc/ctype/Makefile.in @@ -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 index c196350c..00000000 --- a/device/lib/pic16/libc/delay/Makefile +++ /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 index 00000000..2c7d9d11 --- /dev/null +++ b/device/lib/pic16/libc/delay/Makefile.in @@ -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 index c196350c..00000000 --- a/device/lib/pic16/libc/stdio/Makefile +++ /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 index 00000000..2c7d9d11 --- /dev/null +++ b/device/lib/pic16/libc/stdio/Makefile.in @@ -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 index c196350c..00000000 --- a/device/lib/pic16/libc/stdlib/Makefile +++ /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 index 00000000..2c7d9d11 --- /dev/null +++ b/device/lib/pic16/libc/stdlib/Makefile.in @@ -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 index c196350c..00000000 --- a/device/lib/pic16/libc/string/Makefile +++ /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 index 00000000..2c7d9d11 --- /dev/null +++ b/device/lib/pic16/libc/string/Makefile.in @@ -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 index c196350c..00000000 --- a/device/lib/pic16/libc/utils/Makefile +++ /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 index 00000000..2c7d9d11 --- /dev/null +++ b/device/lib/pic16/libc/utils/Makefile.in @@ -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.in similarity index 61% rename from device/lib/pic16/libdev/Makefile rename to device/lib/pic16/libdev/Makefile.in index c56128b5..f3aa4eeb 100644 --- a/device/lib/pic16/libdev/Makefile +++ b/device/lib/pic16/libdev/Makefile.in @@ -16,20 +16,23 @@ ### $Id$ ### -topsrcdir=.. +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ SUBDIRS = MKLIB = device_libs -C_FILES = $(wildcard *.c) +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 : $(topsrcdir)/$(builddir)/device_libs suball +.PHONY : $(top_builddir)$(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;) +$(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 $(topsrcdir)/Makefile.subdir +include $(top_srcdir)/Makefile.subdir diff --git a/device/lib/pic16/libio/Makefile b/device/lib/pic16/libio/Makefile.in similarity index 78% rename from device/lib/pic16/libio/Makefile rename to device/lib/pic16/libio/Makefile.in index ba199bae..1746f526 100644 --- a/device/lib/pic16/libio/Makefile +++ b/device/lib/pic16/libio/Makefile.in @@ -16,12 +16,15 @@ ### $Id$ ### -topsrcdir=.. +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ SUBDIRS = adc i2c usart ifeq ($(origin IO_ARCH),undefined) -include $(topsrcdir)/Makefile.common +include $(top_builddir)Makefile.common .PHONY : all clean clean-intermediate install @@ -29,21 +32,21 @@ include $(topsrcdir)/Makefile.common # 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 \ + $(Q)+cat $(top_builddir)pics.build \ | $(SED) -e "s,[ \t]*#.*$$,," \ | $(GREP) -v "^[ \t]*$$" \ | while read arch; do \ [ "x$${arch}" = "x" ] \ - || ( [ -d "$(builddir)/$${arch}" ] || $(MKDIR) "$(builddir)/$${arch}"; \ + || ( $(MKDIR) "$(top_builddir)$(builddir)/$${arch}"; \ $(MAKE) MKLIB=libio18f$${arch}.lib builddir=$(builddir)/$${arch} ARCH=$${arch} IO_ARCH=$${arch} $(MAKECMDGOALS); ) \ || exit 1; \ done -include $(topsrcdir)/Makefile.rules +include $(top_srcdir)/Makefile.rules else -include $(topsrcdir)/Makefile.subdir +include $(top_srcdir)/Makefile.subdir # prevent library to be build in $(SUBDIRS) as well unexport MKLIB diff --git a/device/lib/pic16/libio/adc/Makefile b/device/lib/pic16/libio/adc/Makefile deleted file mode 100644 index 287b76fd..00000000 --- a/device/lib/pic16/libio/adc/Makefile +++ /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 index 00000000..624ecb34 --- /dev/null +++ b/device/lib/pic16/libio/adc/Makefile.in @@ -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 index 26ecac5c..00000000 --- a/device/lib/pic16/libio/i2c/Makefile +++ /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 index 00000000..217d4692 --- /dev/null +++ b/device/lib/pic16/libio/i2c/Makefile.in @@ -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 index 287b76fd..00000000 --- a/device/lib/pic16/libio/usart/Makefile +++ /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 index 00000000..624ecb34 --- /dev/null +++ b/device/lib/pic16/libio/usart/Makefile.in @@ -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 index da39ef73..00000000 --- a/device/lib/pic16/libm/Makefile +++ /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 index 00000000..8b7be6a9 --- /dev/null +++ b/device/lib/pic16/libm/Makefile.in @@ -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 index b43473ee..00000000 --- a/device/lib/pic16/libsdcc/Makefile +++ /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 index 00000000..2bf35ebf --- /dev/null +++ b/device/lib/pic16/libsdcc/Makefile.in @@ -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 index 87adf7fc..00000000 --- a/device/lib/pic16/libsdcc/char/Makefile +++ /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 index 00000000..6bb1352e --- /dev/null +++ b/device/lib/pic16/libsdcc/char/Makefile.in @@ -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 index 87adf7fc..00000000 --- a/device/lib/pic16/libsdcc/fixed16x16/Makefile +++ /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 index 00000000..6bb1352e --- /dev/null +++ b/device/lib/pic16/libsdcc/fixed16x16/Makefile.in @@ -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 index 87adf7fc..00000000 --- a/device/lib/pic16/libsdcc/float/Makefile +++ /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 index 00000000..6bb1352e --- /dev/null +++ b/device/lib/pic16/libsdcc/float/Makefile.in @@ -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 index 87adf7fc..00000000 --- a/device/lib/pic16/libsdcc/gptr/Makefile +++ /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 index 00000000..6bb1352e --- /dev/null +++ b/device/lib/pic16/libsdcc/gptr/Makefile.in @@ -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 index 87adf7fc..00000000 --- a/device/lib/pic16/libsdcc/int/Makefile +++ /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 index 00000000..6bb1352e --- /dev/null +++ b/device/lib/pic16/libsdcc/int/Makefile.in @@ -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 index 87adf7fc..00000000 --- a/device/lib/pic16/libsdcc/long/Makefile +++ /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 index 00000000..6bb1352e --- /dev/null +++ b/device/lib/pic16/libsdcc/long/Makefile.in @@ -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 index 87adf7fc..00000000 --- a/device/lib/pic16/libsdcc/lregs/Makefile +++ /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 index 00000000..6bb1352e --- /dev/null +++ b/device/lib/pic16/libsdcc/lregs/Makefile.in @@ -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 index 882981fa..00000000 --- a/device/lib/pic16/startup/Makefile +++ /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 index 00000000..f07a7137 --- /dev/null +++ b/device/lib/pic16/startup/Makefile.in @@ -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.in similarity index 65% rename from device/lib/small/Makefile rename to device/lib/small/Makefile.in index b576379c..4acca3f0 100644 --- a/device/lib/small/Makefile +++ b/device/lib/small/Makefile.in @@ -1,4 +1,3 @@ -# Dummy Makefile to get around Subversion all: $(MAKE) -C ../mcs51 all cp ../mcs51/*.rel ../mcs51/*.lib . @@ -6,4 +5,7 @@ all: touch dummy.rel clean: - rm *.rel *.lib + 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.in similarity index 87% rename from device/lib/z80/Makefile rename to device/lib/z80/Makefile.in index fad51ae9..fe7304a0 100644 --- a/device/lib/z80/Makefile +++ b/device/lib/z80/Makefile.in @@ -1,5 +1,8 @@ # libc/z80 Makefile +VPATH = @srcdir@ +srcdir = @srcdir@ + TOPDIR = ../../.. SCC = $(TOPDIR)/bin/sdcc -mz80 @@ -30,3 +33,6 @@ _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 index 05c19762..00000000 --- a/doc/Makefile +++ /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 index 00000000..1b15441e --- /dev/null +++ b/doc/Makefile.in @@ -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 diff --git a/doc/clean.mk b/doc/clean.mk index 469bc7a3..add9f7fa 100644 --- a/doc/clean.mk +++ b/doc/clean.mk @@ -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 # ----------------------------------------- diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx index e66d11e7..353506e9 100644 --- a/doc/sdccman.lyx +++ b/doc/sdccman.lyx @@ -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 index 31979674..00000000 --- a/link/Makefile +++ /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 index 00000000..54cf61a1 --- /dev/null +++ b/link/Makefile.in @@ -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 diff --git a/link/clean.mk b/link/clean.mk index 27351ebf..e8435817 100644 --- a/link/clean.mk +++ b/link/clean.mk @@ -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 diff --git a/link/z80/Makefile.in b/link/z80/Makefile.in index e5184186..1f67a7f7 100644 --- a/link/z80/Makefile.in +++ b/link/z80/Makefile.in @@ -1,106 +1,47 @@ -# -# -# +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 diff --git a/link/z80/clean.mk b/link/z80/clean.mk index 9874fc3f..4e13a896 100644 --- a/link/z80/clean.mk +++ b/link/z80/clean.mk @@ -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 # ----------------------------------------- diff --git a/link/z80/conf.mk b/link/z80/conf.mk index 1ce49560..3fa379d4 100644 --- a/link/z80/conf.mk +++ b/link/z80/conf.mk @@ -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 diff --git a/main_in.mk b/main_in.mk index 2ade72f4..86a5f107 100644 --- a/main_in.mk +++ b/main_in.mk @@ -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 # -------- diff --git a/packihx/Makefile.in b/packihx/Makefile.in index a0a15e24..137a7d63 100644 --- a/packihx/Makefile.in +++ b/packihx/Makefile.in @@ -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 diff --git a/packihx/clean.mk b/packihx/clean.mk index 734faae5..d0469ea5 100644 --- a/packihx/clean.mk +++ b/packihx/clean.mk @@ -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.in similarity index 75% rename from sim/ucsim/Makefile rename to sim/ucsim/Makefile.in index f5854aa2..0a2cccf1 100644 --- a/sim/ucsim/Makefile +++ b/sim/ucsim/Makefile.in @@ -8,19 +8,21 @@ STARTYEAR = 1997 SHELL = /bin/sh -PRJDIR = . include packages.mk #PKGS = cmd.src sim.src gui.src s51.src avr.src z80.src doc -srcdir = . +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\ - cd $$pkg && $(MAKE) $$pkg ; cd ..;\ + $(MAKE) -C $$pkg $$pkg ;\ done $(MAKE) -f main.mk main_app @@ -50,28 +52,28 @@ uninstall: # 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) ;\ + $(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 clean.mk distclean - @for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk distclean ;\ + $(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 + 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); do\ - $(MAKE) -C $$pkg -f clean.mk mostlyclean ;\ + @for pkg in $(PKGS_ALL); do\ + $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk mostlyclean ;\ done @@ -80,8 +82,8 @@ mostlyclean: clean # ----------------------------------------------------------------------- realclean: distclean $(MAKE) -f clean.mk realclean - @for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk realclean ;\ + @for pkg in $(PKGS_ALL); do\ + $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk realclean ;\ done @@ -152,7 +154,7 @@ print-newer: new_files: diff -rNu $$HOME/clean-source/sdcc/sim/ucsim .|\ - grep '^diff' | grep -v "\.svn" | awk '{print $$4}' + grep '^diff' | grep -v .svn | awk '{print $$4}' lines: @find . \( -name '*.[ch]' -o -name '*.cc' -o -name '*.hh' \) \ @@ -162,12 +164,12 @@ lines: # Remaking configuration # ---------------------- configure: configure.in - @$(PRJDIR)/mkecho $(PRJDIR) "RE-CREATING CONFIGURE" + @$(top_srcdir)/mkecho $(top_builddir) "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)" + @$(top_srcdir)/mkecho $(top_builddir) "RE-CHECKING CONFIGURATION (re-creating config.status from configure)" @if [ -x ./config.status ]; then \ ./config.status -recheck;\ else\ @@ -179,11 +181,11 @@ config.status: configure fi makefiles: config.status - @$(PRJDIR)/mkecho $(PRJDIR) "RE-MAKING MAKEFILES" + @$(top_srcdir)/mkecho $(top_builddir) "RE-MAKING MAKEFILES" $(SHELL) ./config.status main.mk: $(srcdir)/main_in.mk config.status - @$(PRJDIR)/mkecho $(PRJDIR) "RE-MAKING MAIN.MK" + @$(top_srcdir)/mkecho $(top_builddir) "RE-MAKING MAIN.MK" $(SHELL) ./config.status freshconf: echo_freshconf configure main.mk ddconfig.h @@ -192,10 +194,10 @@ ddconfig.h: ddconfig_in.h config.status $(SHELL) ./config.status echo_freshconf: - @$(PRJDIR)/mkecho $(PRJDIR) "FRESHCONF" + @$(top_srcdir)/mkecho $(top_builddir) "FRESHCONF" checkconf: - @$(PRJDIR)/mkecho $(PRJDIR) "CHECKCONF" + @$(top_srcdir)/mkecho $(top_builddir) "CHECKCONF" @if [ -f devel ]; then $(MAKE) freshconf; fi # End of Makefile diff --git a/sim/ucsim/avr.src/Makefile.in b/sim/ucsim/avr.src/Makefile.in index f2e1ed16..f05e68d8 100644 --- a/sim/ucsim/avr.src/Makefile.in +++ b/sim/ucsim/avr.src/Makefile.in @@ -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 diff --git a/sim/ucsim/avr.src/conf.mk b/sim/ucsim/avr.src/conf.mk index 7097e848..d61802a1 100644 --- a/sim/ucsim/avr.src/conf.mk +++ b/sim/ucsim/avr.src/conf.mk @@ -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 diff --git a/sim/ucsim/clean.mk b/sim/ucsim/clean.mk index 84fff8d4..4411323e 100644 --- a/sim/ucsim/clean.mk +++ b/sim/ucsim/clean.mk @@ -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 diff --git a/sim/ucsim/cmd.src/Makefile.in b/sim/ucsim/cmd.src/Makefile.in index 644c9df3..b9364dfa 100644 --- a/sim/ucsim/cmd.src/Makefile.in +++ b/sim/ucsim/cmd.src/Makefile.in @@ -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 diff --git a/sim/ucsim/cmd.src/conf.mk b/sim/ucsim/cmd.src/conf.mk index 4bb2a6e2..95075688 100644 --- a/sim/ucsim/cmd.src/conf.mk +++ b/sim/ucsim/cmd.src/conf.mk @@ -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 diff --git a/sim/ucsim/configure b/sim/ucsim/configure index 3c63d5f4..48b58e58 100755 --- a/sim/ucsim/configure +++ b/sim/ucsim/configure @@ -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 < conftest.$ac_ext <&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=$? @@ -10187,13 +10227,28 @@ fi + +#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 diff --git a/sim/ucsim/configure.in b/sim/ucsim/configure.in index 1c9e0592..1faa094b 100644 --- a/sim/ucsim/configure.in +++ b/sim/ucsim/configure.in @@ -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 diff --git a/sim/ucsim/doc/Makefile.in b/sim/ucsim/doc/Makefile.in index ddcbc6ee..2f540fc0 100644 --- a/sim/ucsim/doc/Makefile.in +++ b/sim/ucsim/doc/Makefile.in @@ -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 diff --git a/sim/ucsim/doc/conf.mk b/sim/ucsim/doc/conf.mk index 879e9bc8..ac65f24e 100644 --- a/sim/ucsim/doc/conf.mk +++ b/sim/ucsim/doc/conf.mk @@ -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/sim/ucsim/gui.src/Makefile.in b/sim/ucsim/gui.src/Makefile.in index b1a00771..ac1dcba0 100644 --- a/sim/ucsim/gui.src/Makefile.in +++ b/sim/ucsim/gui.src/Makefile.in @@ -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 diff --git a/sim/ucsim/gui.src/clean.mk b/sim/ucsim/gui.src/clean.mk index d5896439..826170c5 100644 --- a/sim/ucsim/gui.src/clean.mk +++ b/sim/ucsim/gui.src/clean.mk @@ -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 diff --git a/sim/ucsim/gui.src/conf.mk b/sim/ucsim/gui.src/conf.mk index 5c33eb3d..d9a45d91 100644 --- a/sim/ucsim/gui.src/conf.mk +++ b/sim/ucsim/gui.src/conf.mk @@ -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 diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in b/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in index 9ba4c00a..eb5b6151 100644 --- a/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in +++ b/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in @@ -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 diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk b/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk index b3ad7360..344f4f08 100644 --- a/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk +++ b/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk @@ -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 diff --git a/sim/ucsim/gui.src/serio.src/Makefile.in b/sim/ucsim/gui.src/serio.src/Makefile.in index 44363c8e..fbfb7611 100644 --- a/sim/ucsim/gui.src/serio.src/Makefile.in +++ b/sim/ucsim/gui.src/serio.src/Makefile.in @@ -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 diff --git a/sim/ucsim/gui.src/serio.src/conf.mk b/sim/ucsim/gui.src/serio.src/conf.mk index a4bc1a28..73ad16ed 100644 --- a/sim/ucsim/gui.src/serio.src/conf.mk +++ b/sim/ucsim/gui.src/serio.src/conf.mk @@ -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 diff --git a/sim/ucsim/hc08.src/Makefile.in b/sim/ucsim/hc08.src/Makefile.in index b1effd0b..bee1ffdb 100644 --- a/sim/ucsim/hc08.src/Makefile.in +++ b/sim/ucsim/hc08.src/Makefile.in @@ -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 diff --git a/sim/ucsim/hc08.src/conf.mk b/sim/ucsim/hc08.src/conf.mk index 9ab5ebc6..a7a0769c 100644 --- a/sim/ucsim/hc08.src/conf.mk +++ b/sim/ucsim/hc08.src/conf.mk @@ -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 diff --git a/sim/ucsim/libltdl/Makefile.in b/sim/ucsim/libltdl/Makefile.in index 99011b3f..06c4dd1e 100644 --- a/sim/ucsim/libltdl/Makefile.in +++ b/sim/ucsim/libltdl/Makefile.in @@ -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) \ diff --git a/sim/ucsim/main_in.mk b/sim/ucsim/main_in.mk index 3a77bac6..dc2e3e4c 100644 --- a/sim/ucsim/main_in.mk +++ b/sim/ucsim/main_in.mk @@ -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 diff --git a/sim/ucsim/packages_in.mk b/sim/ucsim/packages_in.mk index 4027b938..60e192af 100644 --- a/sim/ucsim/packages_in.mk +++ b/sim/ucsim/packages_in.mk @@ -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 diff --git a/sim/ucsim/s51.src/Makefile.in b/sim/ucsim/s51.src/Makefile.in index 8a5b2e47..357ba6aa 100644 --- a/sim/ucsim/s51.src/Makefile.in +++ b/sim/ucsim/s51.src/Makefile.in @@ -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 diff --git a/sim/ucsim/s51.src/conf.mk b/sim/ucsim/s51.src/conf.mk index 3f6e75a5..ca9aeb98 100644 --- a/sim/ucsim/s51.src/conf.mk +++ b/sim/ucsim/s51.src/conf.mk @@ -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 diff --git a/sim/ucsim/sim.src/Makefile.in b/sim/ucsim/sim.src/Makefile.in index 50a17eea..2be834c5 100644 --- a/sim/ucsim/sim.src/Makefile.in +++ b/sim/ucsim/sim.src/Makefile.in @@ -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 diff --git a/sim/ucsim/sim.src/conf.mk b/sim/ucsim/sim.src/conf.mk index 879e9bc8..ed2b48ab 100644 --- a/sim/ucsim/sim.src/conf.mk +++ b/sim/ucsim/sim.src/conf.mk @@ -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 diff --git a/sim/ucsim/xa.src/Makefile.in b/sim/ucsim/xa.src/Makefile.in index a437fc85..bd69b494 100644 --- a/sim/ucsim/xa.src/Makefile.in +++ b/sim/ucsim/xa.src/Makefile.in @@ -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 diff --git a/sim/ucsim/xa.src/conf.mk b/sim/ucsim/xa.src/conf.mk index 1c008560..e6db37c0 100644 --- a/sim/ucsim/xa.src/conf.mk +++ b/sim/ucsim/xa.src/conf.mk @@ -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 diff --git a/sim/ucsim/z80.src/Makefile.in b/sim/ucsim/z80.src/Makefile.in index fac494d7..f99d384f 100644 --- a/sim/ucsim/z80.src/Makefile.in +++ b/sim/ucsim/z80.src/Makefile.in @@ -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 diff --git a/sim/ucsim/z80.src/conf.mk b/sim/ucsim/z80.src/conf.mk index 23bc4551..728ec313 100644 --- a/sim/ucsim/z80.src/conf.mk +++ b/sim/ucsim/z80.src/conf.mk @@ -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 diff --git a/src/Makefile.in b/src/Makefile.in index 46d0e4c6..6084aa72 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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 index 3b856364..00000000 --- a/src/avr/Makefile +++ /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 index 00000000..dfb8a524 --- /dev/null +++ b/src/avr/Makefile.in @@ -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/clean.mk b/src/clean.mk index 59d80d18..1ff8d748 100644 --- a/src/clean.mk +++ b/src/clean.mk @@ -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 diff --git a/src/conf.mk b/src/conf.mk index 879e9bc8..ac65f24e 100644 --- a/src/conf.mk +++ b/src/conf.mk @@ -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 index 3b856364..00000000 --- a/src/ds390/Makefile +++ /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 index 00000000..dfb8a524 --- /dev/null +++ b/src/ds390/Makefile.in @@ -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 index 3b856364..00000000 --- a/src/ds400/Makefile +++ /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 index 00000000..dfb8a524 --- /dev/null +++ b/src/ds400/Makefile.in @@ -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 index 3b856364..00000000 --- a/src/hc08/Makefile +++ /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 index 00000000..dfb8a524 --- /dev/null +++ b/src/hc08/Makefile.in @@ -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/izt/Makefile b/src/izt/Makefile index 3b856364..b37db767 100644 --- a/src/izt/Makefile +++ b/src/izt/Makefile @@ -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 index 3b856364..00000000 --- a/src/mcs51/Makefile +++ /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 index 00000000..dfb8a524 --- /dev/null +++ b/src/mcs51/Makefile.in @@ -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 index 6fff46fe..00000000 --- a/src/pic/Makefile +++ /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 index 00000000..8f8d493f --- /dev/null +++ b/src/pic/Makefile.in @@ -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 index 3b856364..00000000 --- a/src/pic16/Makefile +++ /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 index 00000000..dfb8a524 --- /dev/null +++ b/src/pic16/Makefile.in @@ -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/pic16/NOTES b/src/pic16/NOTES index 2738b295..16cfa6b4 100644 --- a/src/pic16/NOTES +++ b/src/pic16/NOTES @@ -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 diff --git a/src/port-clean.mk b/src/port-clean.mk index a0855223..205d28f5 100644 --- a/src/port-clean.mk +++ b/src/port-clean.mk @@ -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 diff --git a/src/port.mk b/src/port.mk index 0fcc395c..466a2eae 100644 --- a/src/port.mk +++ b/src/port.mk @@ -5,20 +5,20 @@ # PREBUILD - list of special files to build before deps. # Ports are always located in sdcc/src/ -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 index 3b856364..00000000 --- a/src/xa51/Makefile +++ /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 index 00000000..dfb8a524 --- /dev/null +++ b/src/xa51/Makefile.in @@ -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 index 3b856364..00000000 --- a/src/z80/Makefile +++ /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 index 00000000..dfb8a524 --- /dev/null +++ b/src/z80/Makefile.in @@ -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/support/cpp2/Makefile.in b/support/cpp2/Makefile.in index 44d747a6..90cf7293 100644 --- a/support/cpp2/Makefile.in +++ b/support/cpp2/Makefile.in @@ -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@ # -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) diff --git a/support/cpp2/clean.mk b/support/cpp2/clean.mk index 8ab53b74..eb3d84a8 100644 --- a/support/cpp2/clean.mk +++ b/support/cpp2/clean.mk @@ -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.in similarity index 81% rename from support/librarian/Makefile rename to support/librarian/Makefile.in index 99092d17..b646808b 100644 --- a/support/librarian/Makefile +++ b/support/librarian/Makefile.in @@ -1,6 +1,8 @@ -PRJDIR = ../.. +VPATH = @srcdir@ +srcdir = @srcdir@ +top_builddir = @top_builddir@ -include $(PRJDIR)/Makefile.common +include $(top_builddir)Makefile.common CFLAGS += -Wall @@ -8,7 +10,7 @@ OBJECTS = sdcclib.o SOURCES = $(patsubst %.o,%.c,$(OBJECTS)) -TARGET = $(PRJDIR)/bin/sdcclib$(EXEEXT) +TARGET = $(top_builddir)bin/sdcclib$(EXEEXT) all: $(TARGET) @@ -50,4 +52,4 @@ $(TARGET): $(OBJECTS) checkconf: -include clean.mk +include $(srcdir)/clean.mk diff --git a/support/librarian/clean.mk b/support/librarian/clean.mk index 7e2a3ca0..19bfdf1f 100644 --- a/support/librarian/clean.mk +++ b/support/librarian/clean.mk @@ -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.in similarity index 62% rename from support/makebin/Makefile rename to support/makebin/Makefile.in index b957b8ee..83f5193f 100644 --- a/support/makebin/Makefile +++ b/support/makebin/Makefile.in @@ -1,13 +1,17 @@ -PRJDIR = ../.. +VPATH = @srcdir@ +srcdir = @srcdir@ + +top_builddir = @top_builddir@ SOURCES = makebin.c -BIN = $(PRJDIR)/bin/makebin$(EXEEXT) +BIN = $(top_builddir)bin/makebin$(EXEEXT) -include $(PRJDIR)/Makefile.common +include $(top_builddir)Makefile.common all: $(BIN) $(BIN): $(OBJ) + mkdir -p $(top_builddir)bin $(CC) $(LDFLAGS) -o $(BIN) $(OBJ) install: all @@ -18,4 +22,4 @@ install: all uninstall: rm -f $(DESTDIR)$(bindir)/makebin$(EXEEXT) -include clean.mk +include $(srcdir)/clean.mk diff --git a/support/makebin/clean.mk b/support/makebin/clean.mk index dfe9fb20..715c0ae6 100644 --- a/support/makebin/clean.mk +++ b/support/makebin/clean.mk @@ -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 diff --git a/support/regression/Makefile.in b/support/regression/Makefile.in index 98950bce..5866ce6f 100644 --- a/support/regression/Makefile.in +++ b/support/regression/Makefile.in @@ -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 @@ -42,21 +42,27 @@ 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 diff --git a/support/regression/ports/ds390/spec.mk b/support/regression/ports/ds390/spec.mk index 62de8160..834d5507 100644 --- a/support/regression/ports/ds390/spec.mk +++ b/support/regression/ports/ds390/spec.mk @@ -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 - diff --git a/support/regression/ports/gbz80/spec.mk b/support/regression/ports/gbz80/spec.mk index ef482582..367a2f56 100644 --- a/support/regression/ports/gbz80/spec.mk +++ b/support/regression/ports/gbz80/spec.mk @@ -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 - diff --git a/support/regression/ports/hc08/spec.mk b/support/regression/ports/hc08/spec.mk index 9cb3f958..113f4c64 100644 --- a/support/regression/ports/hc08/spec.mk +++ b/support/regression/ports/hc08/spec.mk @@ -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 - diff --git a/support/regression/ports/host/spec.mk b/support/regression/ports/host/spec.mk index 5d243c81..ab3f89f4 100644 --- a/support/regression/ports/host/spec.mk +++ b/support/regression/ports/host/spec.mk @@ -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: diff --git a/support/regression/ports/mcs51-large/spec.mk b/support/regression/ports/mcs51-large/spec.mk index 339fb86d..5f958a34 100644 --- a/support/regression/ports/mcs51-large/spec.mk +++ b/support/regression/ports/mcs51-large/spec.mk @@ -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 diff --git a/support/regression/ports/mcs51-medium/spec.mk b/support/regression/ports/mcs51-medium/spec.mk index cdc0b050..c30df57d 100644 --- a/support/regression/ports/mcs51-medium/spec.mk +++ b/support/regression/ports/mcs51-medium/spec.mk @@ -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 diff --git a/support/regression/ports/mcs51-stack-auto/spec.mk b/support/regression/ports/mcs51-stack-auto/spec.mk index f9e2b863..fe4cdc62 100644 --- a/support/regression/ports/mcs51-stack-auto/spec.mk +++ b/support/regression/ports/mcs51-stack-auto/spec.mk @@ -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 diff --git a/support/regression/ports/mcs51-xstack-auto/spec.mk b/support/regression/ports/mcs51-xstack-auto/spec.mk index 1b536c9f..2b01fae0 100644 --- a/support/regression/ports/mcs51-xstack-auto/spec.mk +++ b/support/regression/ports/mcs51-xstack-auto/spec.mk @@ -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 diff --git a/support/regression/ports/mcs51/spec.mk b/support/regression/ports/mcs51/spec.mk index 6df802ca..86ec82a2 100644 --- a/support/regression/ports/mcs51/spec.mk +++ b/support/regression/ports/mcs51/spec.mk @@ -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 diff --git a/support/regression/ports/pic16/spec.mk b/support/regression/ports/pic16/spec.mk index fa92ec6d..288edfef 100644 --- a/support/regression/ports/pic16/spec.mk +++ b/support/regression/ports/pic16/spec.mk @@ -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 diff --git a/support/regression/ports/ucz80/spec.mk b/support/regression/ports/ucz80/spec.mk index a4f73bc0..1ea814a7 100644 --- a/support/regression/ports/ucz80/spec.mk +++ b/support/regression/ports/ucz80/spec.mk @@ -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 - diff --git a/support/regression/ports/xa51/spec.mk b/support/regression/ports/xa51/spec.mk index 150800c0..eb50f019 100755 --- a/support/regression/ports/xa51/spec.mk +++ b/support/regression/ports/xa51/spec.mk @@ -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 - - diff --git a/support/regression/ports/z80/spec.mk b/support/regression/ports/z80/spec.mk index 2a568d9d..3c0aebd5 100644 --- a/support/regression/ports/z80/spec.mk +++ b/support/regression/ports/z80/spec.mk @@ -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 - diff --git a/support/regression/tests/libmullong.c b/support/regression/tests/libmullong.c index 8c34a6f4..a469b93a 100644 --- a/support/regression/tests/libmullong.c +++ b/support/regression/tests/libmullong.c @@ -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 diff --git a/support/scripts/sdcc_mingw32 b/support/scripts/sdcc_mingw32 index d9f8bf7d..86e6784d 100755 --- a/support/scripts/sdcc_mingw32 +++ b/support/scripts/sdcc_mingw32 @@ -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.in similarity index 74% rename from support/valdiag/Makefile rename to support/valdiag/Makefile.in index 12c61c1d..7b965496 100644 --- a/support/valdiag/Makefile +++ b/support/valdiag/Makefile.in @@ -1,8 +1,13 @@ .SILENT: -TESTS_DIR = tests +VPATH = @srcdir@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ + +TESTS_DIR = $(srcdir)/tests RESULTS_DIR = results -PORTS_DIR = ports +PORTS_DIR = $(srcdir)/ports BUILD_DIR = gen ALL_PORTS = host mcs51 mcs51-large mcs51-stack-auto ds390 z80 hc08 @@ -26,6 +31,9 @@ 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 @@ -34,11 +42,11 @@ clean-port: $(PORT_RESULTS_DIR)/%.out: $(TESTS_DIR)/%.c echo Processing $< - python valdiag.py $(PORT) $< $(PORT_BUILD_DIR)/$* > $@ + python $(srcdir)/valdiag.py $(PORT) $< $(PORT_BUILD_DIR)/$* > $@ port-results: port-dirs $(PORT_RESULTS) echo Summary for \'$(PORT)\': `cat $(PORT_RESULTS) | \ - python ../regression/collate-results.py` + python $(srcdir)/../regression/collate-results.py` port-dirs: mkdir -p $(PORT_RESULTS_DIR) -- 2.30.2