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@
+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@
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
libs: libutil.a
+main_app: checkconf ucsim_app
+
# Compiling and installing everything and runing test
# ---------------------------------------------------
install: all installdirs
# --------------------
check:
+test:
# Performing installation test
# ----------------------------
# ---------------------
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
# 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 $@
# ----------------------
checkconf:
@if [ -f devel ]; then\
+ echo "MAIN.MK checkconf";\
$(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\
fi