X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fmain_in.mk;h=413f4dbe2f0b6a5b90e76d5d51a7bfe325507e2e;hb=72b7e8dadd92279596c0f56649775fc056acf449;hp=e7c34297b9d629b4be5d09953c93fe0d1738c3cb;hpb=6c239eaa4a76788c737d9b320edd485980bd8226;p=fw%2Fsdcc diff --git a/sim/ucsim/main_in.mk b/sim/ucsim/main_in.mk index e7c34297..413f4dbe 100644 --- a/sim/ucsim/main_in.mk +++ b/sim/ucsim/main_in.mk @@ -14,14 +14,24 @@ RANLIB = @RANLIB@ INSTALL = @INSTALL@ PRJDIR = . +SIMDIR = sim.src +CMDDIR = cmd.src +GUIDIR = gui.src DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@) # FIXME: -Imcs51 must be removed!!! -CPPFLAGS = @CPPFLAGS@ -I$(PRJDIR) +CPPFLAGS = @CPPFLAGS@ -I$(PRJDIR) -I$(PRJDIR)/$(SIMDIR) \ + -I$(CMDDIR) -I$(GUIDIR) CFLAGS = @CFLAGS@ -I$(PRJDIR) -Wall CXXFLAGS = @CXXFLAGS@ -I$(PRJDIR) -Wall M_OR_MM = @M_OR_MM@ +EXEEXT = @EXEEXT@ + +LIB_LIST = util sim cmd sim +UCSIM_LIBS = $(patsubst %,-l%,$(LIB_LIST)) +UCSIM_LIB_FILES = $(patsubst %,lib%.a,$(LIB_LIST)) + prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -34,7 +44,13 @@ man2dir = $(mandir)/man2 infodir = @infodir@ srcdir = @srcdir@ -OBJECTS = pobj.o globals.o utils.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)) +ALL_SOURCES = $(SOURCES) $(UCSIM_SOURCES) + +enable_ucsim = @enable_ucsim@ # Compiling entire program or any subproject @@ -43,6 +59,8 @@ all: checkconf libs libs: libutil.a +main_app: checkconf ucsim_app + # Compiling and installing everything and runing test # --------------------------------------------------- install: all installdirs @@ -51,16 +69,17 @@ 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 $(bindir)/s51$(EXEEXT) + rm -f $(bindir)/savr$(EXEEXT) + rm -f $(bindir)/serialview$(EXEEXT) + rm -f $(bindir)/portmon$(EXEEXT) # Performing self-test # -------------------- check: +test: # Performing installation test # ---------------------------- @@ -76,8 +95,8 @@ installdirs: # --------------------- dep: main.dep -main.dep: *.cc *.h - $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >main.dep +main.dep: $(ALL_SOURCES) *.h + $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(ALL_SOURCES) >main.dep include main.dep include clean.mk @@ -88,11 +107,21 @@ include clean.mk # My rules # -------- - libutil.a: $(OBJECTS) ar -rcu $*.a $(OBJECTS) $(RANLIB) $*.a + +ifeq ($(enable_ucsim),yes) +ucsim_app: libs ucsim +else +ucsim_app: +endif + +ucsim: $(UCSIM_OBJECTS) $(UCSIM_LIB_FILES) + echo $(UCSIM_LIB_FILES) + $(CXX) $(CXXFLAGS) -o $@ $< -L$(PRJDIR) $(UCSIM_LIBS) + .cc.o: $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ @@ -111,6 +140,7 @@ libutil.a: $(OBJECTS) # ---------------------- checkconf: @if [ -f devel ]; then\ + $(PRJDIR)/mkecho $(PRJDIR) "MAIN.MK checkconf";\ $(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\ fi