* device/lib/pic16/Makefile.common.in: added $(MM) to fix `make clean`
[fw/sdcc] / sim / ucsim / avr.src / Makefile.in
index 37a310063adab9125900f7de3870eb80e23b58c0..190cf434b12b1d8f752af21afb50e0aa3106428b 100644 (file)
@@ -23,8 +23,9 @@ CXXFLAGS        = @CXXFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
 PICOPT         = @PICOPT@
 SHAREDLIB      = @SHAREDLIB@
+EXEEXT         = @EXEEXT@
 
-LIBS           = @LIBS@ -L$(PRJDIR) -lsim -lutil -lsim -lcmd -lguiucsim
+LIBS           = @LIBS@ -L$(PRJDIR) -Wl,--start-group -lsim -lutil -lcmd -lguiucsim -Wl,--end-group
 DL             = @DL@
 dl_ok          = @dl_ok@
 
@@ -63,13 +64,13 @@ all: checkconf otherlibs avr.src
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
 install: all installdirs
-       $(INSTALL) -s savr $(bindir)
+       $(INSTALL) -s savr$(EXEEXT) $(DESTDIR)$(bindir)
 
 
 # Deleting all the installed files
 # --------------------------------
 uninstall:
-       rm -f $(bindir)/savr
+       rm -f $(DESTDIR)$(bindir)/savr
 
 
 # Performing self-test
@@ -87,7 +88,7 @@ installcheck:
 # Creating installation directories
 # ---------------------------------
 installdirs:
-       test -d $(bindir) || $(INSTALL) -d $(bindir)
+       test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
 
 
 # Creating dependencies
@@ -108,10 +109,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