X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fmain_in.mk;h=9c277c2da9ff47c0e5e0ab079231cb6c30509777;hb=d25410272593de279e84cf891961c535b8c7fc70;hp=b101d697e9b4b03d476fc73125da62abf8403dc1;hpb=f27da39dbcab5678aca6d8462f1cc37a643f37e9;p=fw%2Fsdcc diff --git a/sim/ucsim/main_in.mk b/sim/ucsim/main_in.mk index b101d697..9c277c2d 100644 --- a/sim/ucsim/main_in.mk +++ b/sim/ucsim/main_in.mk @@ -13,17 +13,19 @@ 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@ EXEEXT = @EXEEXT@ @@ -37,12 +39,14 @@ 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 = pobj.o globals.o utils.o error.o app.o option.o SOURCES = $(patsubst %.o,%.cc,$(OBJECTS)) @@ -69,10 +73,10 @@ install: all installdirs # Deleting all the installed files # -------------------------------- uninstall: - rm -f $(bindir)/s51$(EXEEXT) - rm -f $(bindir)/savr$(EXEEXT) - rm -f $(bindir)/serialview$(EXEEXT) - rm -f $(bindir)/portmon$(EXEEXT) + 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 @@ -95,11 +99,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) $(filter %.cc,$^) >main.dep include main.dep -include clean.mk +include $(srcdir)/clean.mk #parser.cc: parser.y @@ -120,7 +124,7 @@ 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 @@ -132,7 +136,7 @@ ptt: ptt.o # ---------------------- checkconf: @if [ -f devel ]; then\ - $(PRJDIR)/mkecho $(PRJDIR) "MAIN.MK checkconf";\ + $(top_srcdir)/mkecho $(top_builddir) "MAIN.MK checkconf";\ $(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\ fi