4 # (c) Drotos Daniel, Talker Bt. 1997,99
16 top_builddir = @top_builddir@
17 top_srcdir = @top_srcdir@
22 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
23 # FIXME: -Imcs51 must be removed!!!
24 CPPFLAGS = @CPPFLAGS@ -I$(top_builddir) -I$(srcdir) \
25 -I$(top_srcdir)/$(SIMDIR) \
26 -I$(top_srcdir)/$(CMDDIR) -I$(top_srcdir)/$(GUIDIR)
27 CFLAGS = @CFLAGS@ -I$(top_builddir) -Wall
28 CXXFLAGS = @CXXFLAGS@ -I$(top_builddir) -Wall
33 LIB_LIST = ucsimutil cmd sim
34 UCSIM_LIBS = -Wl,--start-group $(patsubst %,-l%,$(LIB_LIST)) -Wl,--end-group
35 UCSIM_LIB_FILES = $(patsubst %,lib%.a,$(LIB_LIST))
38 exec_prefix = @exec_prefix@
42 datarootdir = @datarootdir@
43 includedir = @includedir@
45 man1dir = $(mandir)/man1
46 man2dir = $(mandir)/man2
51 OBJECTS = pobj.o globals.o utils.o error.o app.o option.o
52 SOURCES = $(patsubst %.o,%.cc,$(OBJECTS))
53 UCSIM_OBJECTS = ucsim.o
54 UCSIM_SOURCES = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
55 ALL_SOURCES = $(SOURCES) $(UCSIM_SOURCES)
57 enable_ucsim = @enable_ucsim@
60 # Compiling entire program or any subproject
61 # ------------------------------------------
66 main_app: checkconf ucsim_app
68 # Compiling and installing everything and runing test
69 # ---------------------------------------------------
70 install: all installdirs
73 # Deleting all the installed files
74 # --------------------------------
76 rm -f $(DESTDIR)$(bindir)/s51$(EXEEXT)
77 rm -f $(DESTDIR)$(bindir)/savr$(EXEEXT)
78 rm -f $(DESTDIR)$(bindir)/serialview$(EXEEXT)
79 rm -f $(DESTDIR)$(bindir)/portmon$(EXEEXT)
82 # Performing self-test
83 # --------------------
88 # Performing installation test
89 # ----------------------------
93 # Creating installation directories
94 # ---------------------------------
98 # Creating dependencies
99 # ---------------------
102 main.dep: $(ALL_SOURCES) *.h $(srcdir)/*.h
103 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >main.dep
106 include $(srcdir)/clean.mk
114 libucsimutil.a: $(OBJECTS)
115 ar -rcu $*.a $(OBJECTS)
119 ifeq ($(enable_ucsim),yes)
120 ucsim_app: libs ucsim
125 ucsim: $(UCSIM_OBJECTS) $(UCSIM_LIB_FILES)
126 echo $(UCSIM_LIB_FILES)
127 $(CXX) $(CXXFLAGS) -o $@ $< -L$(top_builddir) $(UCSIM_LIBS)
130 $(CXX) $(CXXFLAGS) -o $@ $< -lpthread
132 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
135 # Remaking configuration
136 # ----------------------
138 @if [ -f devel ]; then\
139 $(top_srcdir)/mkecho $(top_builddir) "MAIN.MK checkconf";\
140 $(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\
143 # End of main_in.mk/main.mk