X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Favr.src%2FMakefile.in;h=c0bde32cc1b871c1e4dea76903815f8ccaa497c7;hb=2738d56c6c0b57108f9f1bb7bb5449c84fcaefda;hp=775edcaa9a9ad8c9ebbd50e179300b57955d767f;hpb=1e5d63db2c3471fc6c0f30ee9a0a90da0f89f7a2;p=fw%2Fsdcc diff --git a/sim/ucsim/avr.src/Makefile.in b/sim/ucsim/avr.src/Makefile.in index 775edcaa..c0bde32c 100644 --- a/sim/ucsim/avr.src/Makefile.in +++ b/sim/ucsim/avr.src/Makefile.in @@ -12,62 +12,79 @@ CPP = @CPP@ CXXCPP = @CXXCPP@ 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 +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 +LDFLAGS = @LDFLAGS@ M_OR_MM = @M_OR_MM@ +PICOPT = @PICOPT@ +SHAREDLIB = @SHAREDLIB@ +EXEEXT = @EXEEXT@ -LIBS = @LIBS@ -L$(PRJDIR) -lsim -lcmd -lutil +LIBS = -L$(top_builddir) -lsim -lucsimutil -lguiucsim -lcmd -lsim @LIBS@ +DL = @DL@ +dl_ok = @dl_ok@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ +datarootdir = @datarootdir@ includedir = @includedir@ mandir = @mandir@ man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 infodir = @infodir@ srcdir = @srcdir@ +VPATH = @srcdir@ -OBJECTS = savr.o glob.o \ +OBJECTS_SHARED = glob.o \ simavr.o avr.o port.o \ inst.o bit_inst.o jump_inst.o move_inst.o logic_inst.o \ arith_inst.o +OBJECTS_EXE = savr.o +OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE) + +enable_dlso = @enable_dlso@ +dlso_ok = @dlso_ok@ AVRASM = tavrasm TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \ - test_arith.hex + test_arith.hex test_call.hex # Compiling entire program or any subproject # ------------------------------------------ -all: checkconf otherlibs avr.src tests - -tests: $(TEST_OBJ) +all: checkconf otherlibs avr.src # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs - $(INSTALL) -s savr $(bindir) + $(INSTALL) savr$(EXEEXT) $(DESTDIR)$(bindir)/savr$(EXEEXT) + $(STRIP) $(DESTDIR)$(bindir)/savr$(EXEEXT) # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/savr + rm -f $(DESTDIR)$(bindir)/savr # Performing self-test # -------------------- -check: +check: $(TEST_OBJ) + +test: # Performing installation test @@ -78,18 +95,18 @@ installcheck: # Creating installation directories # --------------------------------- installdirs: - test -d $(bindir) || $(INSTALL) -d $(bindir) + test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir) # Creating dependencies # --------------------- 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 Makefile.dep +include $(srcdir)/clean.mk #parser.cc: parser.y @@ -99,14 +116,25 @@ include clean.mk # -------- .SUFFIXES: .asm .hex -avr.src: savr +avr.src: savr$(EXEEXT) shared_lib + +savr$(EXEEXT): $(OBJECTS) $(top_builddir)/*.a + $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@ + +ifeq ($(dlso_ok),yes) +shared_lib: $(top_builddir)/savr.so +else +shared_lib: + @$(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 -savr: $(OBJECTS) $(PRJDIR)/*.a - $(CXX) $(CXXFLAGS) -o savr $(OBJECTS) $(LIBS) +$(top_builddir)/savr.so: $(OBJECTS_SHARED) + $(CXX) -shared $(LDFLAGS) $(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 $@ @@ -118,8 +146,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