X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fmain_in.mk;h=dc2e3e4cf0defa063d3a305acc426d1dfc1289d2;hb=8dadebfe7d1580bf76ba2638a4cb3a506751a17e;hp=7d47fb8542680ce18df74f36ca556fa4eca34bd9;hpb=8c8f34ff4281a55d2f535335c02999246e9e12f2;p=fw%2Fsdcc diff --git a/sim/ucsim/main_in.mk b/sim/ucsim/main_in.mk index 7d47fb85..dc2e3e4c 100644 --- a/sim/ucsim/main_in.mk +++ b/sim/ucsim/main_in.mk @@ -13,21 +13,25 @@ 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@ -LIB_LIST = sim cmd sim util -UCSIM_LIBS = $(patsubst %,-l%,$(LIB_LIST)) +EXEEXT = @EXEEXT@ + +LIB_LIST = util cmd sim +UCSIM_LIBS = -Wl,--start-group $(patsubst %,-l%,$(LIB_LIST)) -Wl,--end-group UCSIM_LIB_FILES = $(patsubst %,lib%.a,$(LIB_LIST)) prefix = @prefix@ @@ -41,8 +45,9 @@ man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 infodir = @infodir@ srcdir = @srcdir@ +VPATH = @srcdir@ -OBJECTS = pobj.o globals.o utils.o error.o +OBJECTS = pobj.o globals.o utils.o error.o app.o option.o SOURCES = $(patsubst %.o,%.cc,$(OBJECTS)) UCSIM_OBJECTS = ucsim.o UCSIM_SOURCES = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS)) @@ -67,10 +72,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 $(DESTDIR)$(bindir)/s51$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/savr$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/serialview$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/portmon$(EXEEXT) # Performing self-test @@ -93,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 @@ -118,27 +123,19 @@ 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 .cc.o: $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ -.y.cc: - rm -f $*.cc $*.h - $(YACC) -d $< - mv y.tab.c $*.cc - mv y.tab.h $*.h - -.l.cc: - rm -f $*.cc - $(LEX) -t $< >$*.cc - # Remaking configuration # ---------------------- checkconf: @if [ -f devel ]; then\ - echo "MAIN.MK checkconf";\ + $(top_srcdir)/mkecho $(top_builddir) "MAIN.MK checkconf";\ $(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\ fi