From: bernhardheld Date: Thu, 24 Apr 2003 21:06:59 +0000 (+0000) Subject: EXEEXT introduces to solve Cygwin problems X-Git-Url: https://git.gag.com/?p=fw%2Fsdcc;a=commitdiff_plain;h=72b7e8dadd92279596c0f56649775fc056acf449 EXEEXT introduces to solve Cygwin problems git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2563 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 040bbaa4..8641431f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,46 @@ +2003-04-24 Bernhard Held + + Cygwin's gcc always appends .exe: 'gcc -o a a.c' creates a.exe; + EXEEXT was introduced to fix all related problems with targets + "clean", "install" and "uninstall"; a couple of further flaws + especially with "clean" have been fixed too + * as/mcs51/Makefile.in + * as/mcs51/clean.mk + * as/z80/Makefile + * Makefile + * clean.mk + * debugger/mcs51/Makefile.in + * debugger/mcs51/clean.mk + * link/z80/Makefile + * link/z80/Makefile.in + * link/z80/clean.mk + * link/Makefile + * packihx/Makefile.in + * packihx/clean.mk + * sim/ucsim/Makefile + * sim/ucsim/clean.mk + * sim/ucsim/avr.src/Makefile.in + * sim/ucsim/avr.src/clean.mk + * sim/ucsim/s51.src/Makefile.in + * sim/ucsim/s51.src/clean.mk + * sim/ucsim/xa.src/Makefile.in + * sim/ucsim/xa.src/clean.mk + * sim/ucsim/z80.src/Makefile.in + * sim/ucsim/z80.src/clean.mk + * sim/ucsim/main_in.mk + * sim/ucsim/packages_in.mk + * sim/ucsim/gui.src/Makefile.in + * sim/ucsim/gui.src/serio.src/Makefile.in + * sim/ucsim/gui.src/serio.src/clean.mk + * src/Makefile.in + * src/clean.mk + * support/cpp2/Makefile.in + * support/cpp2/clean.mk + * support/makebin/Makefile + * support/makebin/clean.mk + * support/scripts/sdcc_mingw32: --program-suffix no longer needed + * doc/sdccman.lyx: --program-suffix no longer needed + 2003-04-23 Karl Bongers(apply patches for Martin Helmling) * debugger/mcs51/sdcdb.c,simi.c,cmd.c,.. diff --git a/Makefile b/Makefile index 6d3cd33e..4826af10 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ clean: $(MAKE) -f clean.mk clean @echo "+ Cleaning packages in their directories..." for pkg in $(PKGS); do\ - $(MAKE) PORTS="$(PORTS)" -C $$pkg -f clean.mk clean ;\ + $(MAKE) PORTS="$(PORTS)" EXEEXT=$(EXEEXT) -C $$pkg -f clean.mk clean ;\ done # Deleting all files created by configuring or building the program @@ -127,7 +127,7 @@ distclean: $(MAKE) -f clean.mk distclean @echo "+ DistCleaning packages using clean.mk..." for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg PORTS="$(PORTS)" -f clean.mk distclean ;\ + $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) -f clean.mk distclean ;\ done for pkg in $(SDCC_EXTRA); do \ $(MAKE) -C $$pkg clean; \ @@ -138,7 +138,7 @@ distclean: mostlyclean: clean $(MAKE) -f clean.mk mostlyclean for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" mostlyclean ;\ + $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" EXEEXT=$(EXEEXT) mostlyclean ;\ done @@ -148,7 +148,7 @@ mostlyclean: clean realclean: distclean $(MAKE) -f clean.mk realclean for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" realclean ;\ + $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" EXEEXT=$(EXEEXT) realclean ;\ done diff --git a/as/mcs51/Makefile.in b/as/mcs51/Makefile.in index 1c4e48b8..e57638c7 100644 --- a/as/mcs51/Makefile.in +++ b/as/mcs51/Makefile.in @@ -27,6 +27,8 @@ man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 infodir = @info@ +EXEEXT = @EXEEXT@ + CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR) CFLAGS = @CFLAGS@ -Wall M_OR_MM = @M_OR_MM@ @@ -43,8 +45,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 -ASLINK = $(PRJDIR)/bin/aslink +ASX8051 = $(PRJDIR)/bin/asx8051$(EXEEXT) +ASLINK = $(PRJDIR)/bin/aslink$(EXEEXT) transform = @program_transform_name@ @@ -61,15 +63,15 @@ $(ASLINK): $(LKOBJECTS) # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - $(INSTALL) $(ASX8051) `echo $(bindir)/asx8051|sed '$(transform)'` - $(STRIP) `echo $(bindir)/asx8051|sed '$(transform)'` - $(INSTALL) $(ASLINK) `echo $(bindir)/aslink|sed '$(transform)'` - $(STRIP) `echo $(bindir)/aslink|sed '$(transform)'` + $(INSTALL) $(ASX8051) `echo $(bindir)/asx8051$(EXEEXT)|sed '$(transform)'` + $(STRIP) `echo $(bindir)/asx8051$(EXEEXT)|sed '$(transform)'` + $(INSTALL) $(ASLINK) `echo $(bindir)/aslink$(EXEEXT)|sed '$(transform)'` + $(STRIP) `echo $(bindir)/aslink$(EXEEXT)|sed '$(transform)'` # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/asx8051 $(bindir)/aslink + rm -f $(bindir)/asx8051$(EXEEXT) $(bindir)/aslink$(EXEEXT) # Performing self-test diff --git a/as/mcs51/clean.mk b/as/mcs51/clean.mk index 4704a9b3..a4478815 100644 --- a/as/mcs51/clean.mk +++ b/as/mcs51/clean.mk @@ -1,9 +1,12 @@ # Deleting all files created by building the program # -------------------------------------------------- +include ../../Makefile.common +PRJDIR = ../.. + clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ - rm -f $(PRJDIR)/asx8051 $(PRJDIR)/aslink asx8051 aslink + rm -f $(PRJDIR)/bin/asx8051$(EXEEXT) $(PRJDIR)/bin/aslink$(EXEEXT) asx8051$(EXEEXT) aslink$(EXEEXT) # Deleting all files created by configuring or building the program diff --git a/as/z80/Makefile b/as/z80/Makefile index 9a914813..beb428f4 100644 --- a/as/z80/Makefile +++ b/as/z80/Makefile @@ -14,7 +14,7 @@ SRC = asdata.c asexpr.c aslex.c aslist.c asmain.c asout.c \ OBJS = $(SRC:%.c=$(OBJDIR)/%.o) SLIBOBJS = $(SLIBSRC:%.c=$(OBJDIR)/%.o) -BINS = $(BUILDDIR)as$(EXT) +BINS = $(BUILDDIR)as$(EXT)$(EXEEXT) CFLAGS += $(CPPFLAGS) $(OPTS) -I. -DINDEXLIB -DMLH_MAP -DUNIX -DSDK CFLAGS += -funsigned-char diff --git a/clean.mk b/clean.mk index a7ec1016..591147a2 100644 --- a/clean.mk +++ b/clean.mk @@ -3,7 +3,7 @@ clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ - -rm -f bin/* + find bin -type f ! -name README -exec rm {} \; # Deleting all files created by configuring or building the program # ----------------------------------------------------------------- diff --git a/debugger/mcs51/Makefile.in b/debugger/mcs51/Makefile.in index b85db47a..9b6e13c7 100644 --- a/debugger/mcs51/Makefile.in +++ b/debugger/mcs51/Makefile.in @@ -34,6 +34,8 @@ CFLAGS = @CFLAGS@ M_OR_MM = @M_OR_MM@ LDFLAGS = @LDFLAGS@ +EXEEXT = @EXEEXT@ + LIBS = @LIBS@ LIBDIRS = @@ -44,7 +46,7 @@ OBJECTS = sdcdb.o symtab.o simi.o $(PRJDIR)/src/SDCCset.o \ $(PRJDIR)/support/Util/SDCCerr.o SOURCES = $(patsubst %.o,%.c,$(OBJECTS)) -TARGET = $(PRJDIR)/bin/sdcdb +TARGET = $(PRJDIR)/bin/sdcdb$(EXEEXT) # Compiling entire program or any subproject @@ -54,8 +56,8 @@ all: checkconf $(TARGET) # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - $(INSTALL) $(TARGET) $(bindir)/sdcdb - $(STRIP) $(bindir)/sdcdb + $(INSTALL) $(TARGET) $(bindir)/sdcdb$(EXEEXT) + $(STRIP) $(bindir)/sdcdb$(EXEEXT) cp $(PRJDIR)/debugger/mcs51/sdcdb.el $(bindir)/sdcdb.el cp $(PRJDIR)/debugger/mcs51/sdcdbsrc.el $(bindir)/sdcdbsrc.el @@ -63,7 +65,7 @@ install: all installdirs # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/sdcdb + rm -f $(bindir)/sdcdb$(EXEEXT) rm -f $(bindir)/sdcdb.el rm -f $(bindir)/sdcdbsrc.el diff --git a/debugger/mcs51/clean.mk b/debugger/mcs51/clean.mk index 3a67269c..6c54d98c 100644 --- a/debugger/mcs51/clean.mk +++ b/debugger/mcs51/clean.mk @@ -1,9 +1,11 @@ # Deleting all files created by building the program # -------------------------------------------------- +PRJDIR = ../.. + clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ - rm -f $(PRJDIR)/bin/sdcdb \ + rm -f $(PRJDIR)/bin/sdcdb$(EXEEXT) \ $(PRJDIR)/support/Util/SDCCerr.o # Deleting all files created by configuring or building the program diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx index 61e8d9eb..fa87ad1d 100644 --- a/doc/sdccman.lyx +++ b/doc/sdccman.lyx @@ -1061,19 +1061,6 @@ lib ---disable-ucsim \backslash -\layout LyX-Code - - ---program-suffix= -\begin_inset Quotes srd -\end_inset - -.exe -\begin_inset Quotes srd -\end_inset - - -\backslash - \layout LyX-Code ---host=i586-mingw32msvc ---build=unknown-unknown-linux-gnu diff --git a/link/Makefile b/link/Makefile index e58ca903..64c568d6 100644 --- a/link/Makefile +++ b/link/Makefile @@ -8,12 +8,12 @@ all: $(MAKE) -C z80 _link-z80 _link-gbz80 E=$(E) BUILDDIR=../../bin/ install: all - $(INSTALL) $(PRJDIR)/bin/link-z80 `echo $(bindir)/link-z80|sed '$(transform)'` - $(STRIP) `echo $(bindir)/link-z80|sed '$(transform)'` - $(INSTALL) $(PRJDIR)/bin/link-gbz80 `echo $(bindir)/link-gbz80|sed '$(transform)'` - $(STRIP) `echo $(bindir)/link-gbz80|sed '$(transform)'` + $(INSTALL) $(PRJDIR)/bin/link-z80$(EXEEXT) `echo $(bindir)/link-z80$(EXEEXT)|sed '$(transform)'` + $(STRIP) `echo $(bindir)/link-z80$(EXEEXT)|sed '$(transform)'` + $(INSTALL) $(PRJDIR)/bin/link-gbz80$(EXEEXT) `echo $(bindir)/link-gbz80$(EXEEXT)|sed '$(transform)'` + $(STRIP) `echo $(bindir)/link-gbz80$(EXEEXT)|sed '$(transform)'` uninstall: - cd $(bindir); rm -f link-z80 link-gbz80 + cd $(bindir); rm -f link-z80$(EXEEXT) link-gbz80$(EXEEXT) include clean.mk diff --git a/link/z80/Makefile b/link/z80/Makefile index 9a9c80b9..33764018 100644 --- a/link/z80/Makefile +++ b/link/z80/Makefile @@ -13,7 +13,7 @@ SRC = lkarea.c lkdata.c lkeval.c lkhead.c lkihx.c lklex.c \ OBJS = $(SRC:%.c=$(OBJDIR)/%.o) SLIBOBJS = $(SLIBSRC:%.c=$(OBJDIR)/%.o) -BINS = $(BUILDDIR)link$(EXT) +BINS = $(BUILDDIR)link$(EXT)$(EXEEXT) CFLAGS += $(CPPFLAGS) $(OPTS) -DINDEXLIB -DMLH_MAP -DUNIX -DSDK CFLAGS += -funsigned-char -DUNIX diff --git a/link/z80/Makefile.in b/link/z80/Makefile.in index ed966a28..adc87f42 100644 --- a/link/z80/Makefile.in +++ b/link/z80/Makefile.in @@ -14,6 +14,8 @@ INSTALL = @INSTALL@ PRJDIR = ../.. +EXEEXT = @EXEEXT@ + srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -40,7 +42,7 @@ LKOBJECTS = lkarea.o lkdata.o lkeval.o lkhead.o lkihx.o lklex.o \ lkgb.o lkgg.o LKSOURCES = $(patsubst %.o,%.c,$(LKOBJECTS)) -LKZ80 = $(PRJDIR)/bin/link-z80 +LKZ80 = $(PRJDIR)/bin/link-z80$(EXEEXT) # Compiling entire program or any subproject # ------------------------------------------ @@ -52,12 +54,12 @@ $(LKZ80): $(SLIBOBJS) $(LKOBJECTS) # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - $(INSTALL) $(LKZ80) $(bindir)/link-z80 + $(INSTALL) $(LKZ80) $(bindir)/link-z80$(EXEEXT) # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/link-z80 + rm -f $(bindir)/link-z80$(EXEEXT) # Performing self-test diff --git a/link/z80/clean.mk b/link/z80/clean.mk index 8394c52a..9874fc3f 100644 --- a/link/z80/clean.mk +++ b/link/z80/clean.mk @@ -1,9 +1,13 @@ # Deleting all files created by building the program # -------------------------------------------------- +PRJDIR = ../.. +include $(PRJDIR)/Makefile.common + clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ - rm -f $(PRJDIR)/link-z80 link-z80 + rm -f $(PRJDIR)/bin/link-z80$(EXEEXT) link-z80$(EXEEXT) \ + $(PRJDIR)/bin/link-gbz80$(EXEEXT) link-gbz80$(EXEEXT) rm -f *.dep rm -rf obj diff --git a/packihx/Makefile.in b/packihx/Makefile.in index 8fe6bfc9..f361f6e2 100644 --- a/packihx/Makefile.in +++ b/packihx/Makefile.in @@ -8,18 +8,18 @@ OBJECTS = packihx.o SOURCES = $(patsubst %.o,%.c,$(OBJECTS)) -TARGET = $(PRJDIR)/bin/packihx +TARGET = $(PRJDIR)/bin/packihx$(EXEEXT) all: $(TARGET) install: all installdirs - $(INSTALL) $(TARGET) `echo $(bindir)/packihx|sed '$(transform)'` - $(STRIP) `echo $(bindir)/packihx|sed '$(transform)'` + $(INSTALL) $(TARGET) `echo $(bindir)/packihx$(EXEEXT)|sed '$(transform)'` + $(STRIP) `echo $(bindir)/packihx$(EXEEXT)|sed '$(transform)'` # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/packihx + rm -f $(bindir)/packihx$(EXEEXT) # Performing self-test # -------------------- diff --git a/packihx/clean.mk b/packihx/clean.mk index 64f8c1a0..734faae5 100644 --- a/packihx/clean.mk +++ b/packihx/clean.mk @@ -1,7 +1,9 @@ +PRJDIR = .. + clean: rm -f *core *[%~] *.[oa] *.output rm -f .[a-z]*~ \#* - rm -f packihx + rm -f $(PRJDIR)/bin/packihx$(EXEEXT) distclean realclean: clean rm -f config.* Makefile diff --git a/sim/ucsim/Makefile b/sim/ucsim/Makefile index 04c9953d..ce162ff1 100644 --- a/sim/ucsim/Makefile +++ b/sim/ucsim/Makefile @@ -50,9 +50,9 @@ uninstall: # Deleting all files created by building the program # -------------------------------------------------- clean: - $(MAKE) -f clean.mk clean + $(MAKE) -f clean.mk clean EXEEXT=$(EXEEXT) @for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk clean ;\ + $(MAKE) -C $$pkg -f clean.mk clean EXEEXT=$(EXEEXT) ;\ done diff --git a/sim/ucsim/avr.src/Makefile.in b/sim/ucsim/avr.src/Makefile.in index 37a31006..57cbf209 100644 --- a/sim/ucsim/avr.src/Makefile.in +++ b/sim/ucsim/avr.src/Makefile.in @@ -24,6 +24,8 @@ M_OR_MM = @M_OR_MM@ PICOPT = @PICOPT@ SHAREDLIB = @SHAREDLIB@ +EXEEXT = @EXEEXT@ + LIBS = @LIBS@ -L$(PRJDIR) -lsim -lutil -lsim -lcmd -lguiucsim DL = @DL@ dl_ok = @dl_ok@ @@ -63,13 +65,13 @@ all: checkconf otherlibs avr.src # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - $(INSTALL) -s savr $(bindir) + $(INSTALL) -s savr$(EXEEXT) $(bindir) # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/savr + rm -f $(bindir)/savr$(EXEEXT) # Performing self-test @@ -108,10 +110,10 @@ include clean.mk # -------- .SUFFIXES: .asm .hex -avr.src: savr shared_lib +avr.src: savr$(EXEEXT) shared_lib -savr: $(OBJECTS) $(PRJDIR)/*.a - $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o savr +savr$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a + $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@ ifeq ($(dlso_ok),yes) shared_lib: $(PRJDIR)/savr.so diff --git a/sim/ucsim/avr.src/clean.mk b/sim/ucsim/avr.src/clean.mk index 03429cbc..e81b3cc7 100644 --- a/sim/ucsim/avr.src/clean.mk +++ b/sim/ucsim/avr.src/clean.mk @@ -5,7 +5,7 @@ clean: rm -f *core *[%~] *.[oa] *.map rm -f .[a-z]*~ - rm -f savr + rm -f savr$(EXEEXT) # Deleting all files created by configuring or building the program diff --git a/sim/ucsim/clean.mk b/sim/ucsim/clean.mk index 93eefab0..7643b5e1 100644 --- a/sim/ucsim/clean.mk +++ b/sim/ucsim/clean.mk @@ -1,7 +1,7 @@ # Deleting all files created by building the program # -------------------------------------------------- clean: - rm -f *core *[%~] *.[oa] *.so ucsim + rm -f *core *[%~] *.[oa] *.so ucsim$(EXEEXT) rm -f .[a-z]*~ diff --git a/sim/ucsim/gui.src/Makefile.in b/sim/ucsim/gui.src/Makefile.in index 4b09fab8..1364969c 100644 --- a/sim/ucsim/gui.src/Makefile.in +++ b/sim/ucsim/gui.src/Makefile.in @@ -92,9 +92,11 @@ install_gui_api: # Deleting all the installed files # -------------------------------- uninstall: uninstall_gui_api +ifeq ($(curses_ok),yes) @for pkg in $(PKGS); do\ cd $$pkg && $(MAKE) uninstall ; cd ..;\ done +endif uninstall_gui_api: diff --git a/sim/ucsim/gui.src/serio.src/Makefile.in b/sim/ucsim/gui.src/serio.src/Makefile.in index 2044473c..9c71adcd 100644 --- a/sim/ucsim/gui.src/serio.src/Makefile.in +++ b/sim/ucsim/gui.src/serio.src/Makefile.in @@ -17,6 +17,8 @@ M_OR_MM = @M_OR_MM@ LIBS = @CURSES_LIBS@ @LIBS@ +EXEEXT = @EXEEXT@ + curses_ok = @curses_ok@ prefix = @prefix@ @@ -39,7 +41,7 @@ OBJECTS = main.o fileio.o frontend.o posix_signal.o all: serio.src ifeq ($(curses_ok),yes) -serio.src: checkconf serialview +serio.src: checkconf serialview$(EXEEXT) else serio.src: checkconf endif @@ -48,13 +50,13 @@ endif # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - $(INSTALL) -s serialview $(bindir) + $(INSTALL) -s serialview$(EXEEXT) $(bindir) # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/serialview + rm -f $(bindir)/serialview$(EXEEXT) # Performing self-test @@ -88,7 +90,7 @@ include clean.mk # My rules # -------- -serialview: $(OBJECTS) +serialview$(EXEEXT): $(OBJECTS) $(CXX) -o $@ $(LDFLAGS) $(OBJECTS) $(LIBS) .cc.o: diff --git a/sim/ucsim/gui.src/serio.src/clean.mk b/sim/ucsim/gui.src/serio.src/clean.mk index 15d74cd6..f50d8c67 100644 --- a/sim/ucsim/gui.src/serio.src/clean.mk +++ b/sim/ucsim/gui.src/serio.src/clean.mk @@ -5,7 +5,7 @@ clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ - rm -f serialview + rm -f serialview$(EXEEXT) # Deleting all files created by configuring or building the program diff --git a/sim/ucsim/main_in.mk b/sim/ucsim/main_in.mk index 99cfc232..413f4dbe 100644 --- a/sim/ucsim/main_in.mk +++ b/sim/ucsim/main_in.mk @@ -26,6 +26,8 @@ CFLAGS = @CFLAGS@ -I$(PRJDIR) -Wall CXXFLAGS = @CXXFLAGS@ -I$(PRJDIR) -Wall M_OR_MM = @M_OR_MM@ +EXEEXT = @EXEEXT@ + LIB_LIST = util sim cmd sim UCSIM_LIBS = $(patsubst %,-l%,$(LIB_LIST)) UCSIM_LIB_FILES = $(patsubst %,lib%.a,$(LIB_LIST)) @@ -67,10 +69,10 @@ install: all installdirs # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/s51 - rm -f $(bindir)/savr - rm -f $(bindir)/serialview - rm -f $(bindir)/portmon + rm -f $(bindir)/s51$(EXEEXT) + rm -f $(bindir)/savr$(EXEEXT) + rm -f $(bindir)/serialview$(EXEEXT) + rm -f $(bindir)/portmon$(EXEEXT) # Performing self-test diff --git a/sim/ucsim/packages_in.mk b/sim/ucsim/packages_in.mk index 6a3675d3..616513ff 100644 --- a/sim/ucsim/packages_in.mk +++ b/sim/ucsim/packages_in.mk @@ -1,3 +1,5 @@ +EXEEXT = @EXEEXT@ + enable_51 = @enable_51@ enable_avr = @enable_avr@ enable_z80 = @enable_z80@ diff --git a/sim/ucsim/s51.src/Makefile.in b/sim/ucsim/s51.src/Makefile.in index 4e5da1d7..89a45c9e 100644 --- a/sim/ucsim/s51.src/Makefile.in +++ b/sim/ucsim/s51.src/Makefile.in @@ -45,6 +45,8 @@ man2dir = $(mandir)/man2 infodir = @infodir@ srcdir = @srcdir@ +EXEEXT = @EXEEXT@ + OBJECTS_SHARED = glob.o sim51.o \ inc.o jmp.o mov.o logic.o arith.o bit.o \ timer0.o timer1.o timer2.o serial.o port.o interrupt.o \ @@ -66,14 +68,13 @@ all: checkconf otherlibs s51.src # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - if test -f s51.exe; then $(INSTALL) -s s51.exe $(bindir); $(STRIP) $(bindir)/s51.exe; fi - if test -f s51; then $(INSTALL) -s s51 $(bindir); $(STRIP) $(bindir)/s51; fi + $(INSTALL) -s s51$(EXEEXT) $(bindir) # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/s51 + rm -f $(bindir)/s51$(EXEEXT) # Performing self-test @@ -114,10 +115,10 @@ include clean.mk # -------- .SUFFIXES: .rel -s51.src: s51 shared_lib +s51.src: s51$(EXEEXT) shared_lib -s51: $(OBJECTS) $(PRJDIR)/*.a - $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o s51 +s51$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a + $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@ ifeq ($(dlso_ok),yes) shared_lib: $(PRJDIR)/s51.so @@ -128,7 +129,7 @@ shared_lib: endif $(PRJDIR)/s51.so: $(OBJECTS_SHARED) - $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/s51.so + $(CXX) -shared $(OBJECTS_SHARED) -o $@ otherlibs: cd $(PRJDIR)/cmd.src && $(MAKE) all diff --git a/sim/ucsim/s51.src/clean.mk b/sim/ucsim/s51.src/clean.mk index b12c6104..72a866e4 100644 --- a/sim/ucsim/s51.src/clean.mk +++ b/sim/ucsim/s51.src/clean.mk @@ -6,7 +6,7 @@ clean: rm -f *core *[%~] *.[oa] rm -f test_*.??* '(null).cdb' *.lnk *.ihx rm -f .[a-z]*~ - rm -f s51 + rm -f s51$(EXEEXT) # Deleting all files created by configuring or building the program diff --git a/sim/ucsim/xa.src/Makefile.in b/sim/ucsim/xa.src/Makefile.in index 56e5fd09..de623682 100644 --- a/sim/ucsim/xa.src/Makefile.in +++ b/sim/ucsim/xa.src/Makefile.in @@ -15,6 +15,8 @@ INSTALL = @INSTALL@ PRJDIR = .. +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 @@ -55,13 +57,13 @@ tests: $(TEST_OBJ) # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - $(INSTALL) -s sxa $(bindir) + $(INSTALL) -s sxa$(EXEEXT) $(bindir) # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/sxa + rm -f $(bindir)/sxa$(EXEEXT) # Performing self-test @@ -94,10 +96,10 @@ include clean.mk # -------- .SUFFIXES: .asm .hex -xa.src: sxa +xa.src: sxa$(EXEEXT) -sxa: $(OBJECTS) $(PRJDIR)/*.a - $(CXX) $(CXXFLAGS) -o sxa $(OBJECTS) $(LIBS) +sxa$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a + $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS) otherlibs: cd $(PRJDIR)/cmd.src && $(MAKE) all diff --git a/sim/ucsim/xa.src/clean.mk b/sim/ucsim/xa.src/clean.mk index 4975190b..f7f24160 100644 --- a/sim/ucsim/xa.src/clean.mk +++ b/sim/ucsim/xa.src/clean.mk @@ -3,7 +3,7 @@ clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ - rm -f sxa + rm -f sxa$(EXEEXT) # Deleting all files created by configuring or building the program diff --git a/sim/ucsim/z80.src/Makefile.in b/sim/ucsim/z80.src/Makefile.in index 40fc4566..8aed4371 100644 --- a/sim/ucsim/z80.src/Makefile.in +++ b/sim/ucsim/z80.src/Makefile.in @@ -24,6 +24,8 @@ M_OR_MM = @M_OR_MM@ PICOPT = @PICOPT@ SHAREDLIB = @SHAREDLIB@ +EXEEXT = @EXEEXT@ + LIBS = @LIBS@ -L$(PRJDIR) -lutil -lsim -lutil -lcmd -lguiucsim DL = @DL@ dl_ok = @dl_ok@ @@ -70,13 +72,13 @@ tests: $(TEST_OBJ) # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - $(INSTALL) -s sz80 $(bindir) + $(INSTALL) -s sz80$(EXEEXT) $(bindir) # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/sz80 + rm -f $(bindir)/sz80$(EXEEXT) # Performing self-test @@ -111,10 +113,10 @@ include clean.mk # -------- .SUFFIXES: .asm .hex -z80.src: sz80 shared_lib +z80.src: sz80$(EXEEXT) shared_lib -sz80: $(OBJECTS) $(PRJDIR)/*.a - $(CXX) $(CXXFLAGS) -o sz80 $(OBJECTS) $(LIBS) +sz80$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a + $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LIBS) ifeq ($(dlso_ok),yes) shared_lib: $(PRJDIR)/sz80.so diff --git a/sim/ucsim/z80.src/clean.mk b/sim/ucsim/z80.src/clean.mk index b8362d00..5781b8c3 100644 --- a/sim/ucsim/z80.src/clean.mk +++ b/sim/ucsim/z80.src/clean.mk @@ -3,7 +3,7 @@ clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ - rm -f sz80 + rm -f sz80$(EXEEXT) # Deleting all files created by configuring or building the program diff --git a/src/Makefile.in b/src/Makefile.in index de2108db..1c3d85b2 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -56,14 +56,14 @@ $(PRJDIR)/support/gc/libgc.a: # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - $(INSTALL) $(TARGET) `echo $(bindir)/sdcc|sed '$(transform)'` - $(STRIP) `echo $(bindir)/sdcc|sed '$(transform)'` + $(INSTALL) $(TARGET) `echo $(bindir)/sdcc$(EXEEXT)|sed '$(transform)'` + $(STRIP) `echo $(bindir)/sdcc$(EXEEXT)|sed '$(transform)'` # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/sdcc + rm -f $(bindir)/sdcc$(EXEEXT) # Performing self-test # -------------------- diff --git a/src/clean.mk b/src/clean.mk index 21d366e8..074e9cf0 100644 --- a/src/clean.mk +++ b/src/clean.mk @@ -6,7 +6,7 @@ PRJDIR = .. clean: rm -f *core *[%~] *.[oa] *.output rm -f .[a-z]*~ \#* - rm -f $(PRJDIR)/bin/sdcc sdcc + rm -f $(PRJDIR)/bin/sdcc$(EXEEXT) sdcc$(EXEEXT) for port in $(CLEANALLPORTS) ; do\ $(MAKE) -C $$port -f ../port-clean.mk clean ;\ done diff --git a/support/cpp2/clean.mk b/support/cpp2/clean.mk index 8b506b61..8ab53b74 100644 --- a/support/cpp2/clean.mk +++ b/support/cpp2/clean.mk @@ -5,7 +5,7 @@ PRJDIR = ../.. clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ - rm -f $(PRJDIR)/bin/sdcpp + rm -f $(PRJDIR)/bin/sdcpp$(EXEEXT) # Deleting all files created by configuring or building the program diff --git a/support/makebin/Makefile b/support/makebin/Makefile index de2ea9ae..66e49b30 100644 --- a/support/makebin/Makefile +++ b/support/makebin/Makefile @@ -1,7 +1,7 @@ PRJDIR = ../.. SOURCES = makebin.c -BIN = $(PRJDIR)/bin/makebin +BIN = $(PRJDIR)/bin/makebin$(EXEEXT) include $(PRJDIR)/Makefile.common @@ -12,9 +12,10 @@ $(BIN): $(OBJ) install: all mkdir -p $(bindir) - $(INSTALL) $(BIN) `echo $(bindir)/makebin|sed '$(transform)'` + $(INSTALL) $(BIN) `echo $(bindir)/makebin$(EXEEXT)|sed '$(transform)'` + $(STRIP) `echo $(bindir)/makebin$(EXEEXT)|sed '$(transform)'` uninstall: - rm -f $(bindir)/makebin + rm -f $(bindir)/makebin$(EXEEXT) include clean.mk diff --git a/support/makebin/clean.mk b/support/makebin/clean.mk index db12b136..dfe9fb20 100644 --- a/support/makebin/clean.mk +++ b/support/makebin/clean.mk @@ -1,8 +1,10 @@ # Deleting all files created by building the program # -------------------------------------------------- +PRJDIR = ../.. + clean: rm -rf obj - rm -f *core *[%~] *.[oa] makebin + rm -f *core *[%~] *.[oa] $(PRJDIR)/bin/makebin$(EXEEXT) rm -f *.[a-z]*~ # Deleting all files created by configuring or building the program diff --git a/support/scripts/sdcc_mingw32 b/support/scripts/sdcc_mingw32 index 6f88e957..d9f8bf7d 100755 --- a/support/scripts/sdcc_mingw32 +++ b/support/scripts/sdcc_mingw32 @@ -16,7 +16,6 @@ lib_dir_suffix=lib \ sdccconf_h_dir_separator=\\\\ \ --disable-device-lib-build \ --disable-ucsim \ ---program-suffix=.exe \ --host=i586-mingw32msvc --build=unknown-unknown-linux-gnu" ./configure $SDCCCONFIGUREFLAGS