applied patch fixing GCC 4.1 build submitted by the Debian SDCC maintainer Aurelien...
[fw/sdcc] / sim / ucsim / z80.src / Makefile.in
index 928dc93be295fe58424a4c5f67c6ce0af9860669..fac494d761af457569aa62307632151b56c741c0 100644 (file)
@@ -12,6 +12,7 @@ CPP           = @CPP@
 CXXCPP         = @CXXCPP@
 RANLIB         = @RANLIB@
 INSTALL                = @INSTALL@
+STRIP          = @STRIP@
 
 PRJDIR         = ..
 
@@ -23,8 +24,9 @@ CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
 PICOPT         = @PICOPT@
 SHAREDLIB      = @SHAREDLIB@
+EXEEXT         = @EXEEXT@
 
-LIBS           = @LIBS@ -L$(PRJDIR) -lsim -lcmd -lutil -lguiucsim
+LIBS           = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
 DL             = @DL@
 dl_ok          = @dl_ok@
 
@@ -70,13 +72,14 @@ tests: $(TEST_OBJ)
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
 install: all installdirs
-       $(INSTALL) -s sz80 $(bindir)
+       $(INSTALL) sz80$(EXEEXT) $(DESTDIR)$(bindir)/sz80$(EXEEXT)
+       $(STRIP) $(DESTDIR)$(bindir)/sz80$(EXEEXT)
 
 
 # Deleting all the installed files
 # --------------------------------
 uninstall:
-       rm -f $(bindir)/sz80
+       rm -f $(DESTDIR)$(bindir)/sz80$(EXEEXT)
 
 
 # Performing self-test
@@ -94,7 +97,7 @@ installcheck:
 # Creating installation directories
 # ---------------------------------
 installdirs:
-       test -d $(bindir) || $(INSTALL) -d $(bindir)
+       test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
 
 
 # Creating dependencies
@@ -111,17 +114,17 @@ 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
 else
 shared_lib:
-       @echo "No z80 shared lib made."
-       @echo "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
+       @$(PRJDIR)/mkecho $(PRJDIR) "No z80 shared lib made."
+       @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
 endif
 
 $(PRJDIR)/sz80.so: $(OBJECTS_SHARED)