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 = util 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 includedir = @includedir@
44 man1dir = $(mandir)/man1
45 man2dir = $(mandir)/man2
50 OBJECTS = pobj.o globals.o utils.o error.o app.o option.o
51 SOURCES = $(patsubst %.o,%.cc,$(OBJECTS))
52 UCSIM_OBJECTS = ucsim.o
53 UCSIM_SOURCES = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
54 ALL_SOURCES = $(SOURCES) $(UCSIM_SOURCES)
56 enable_ucsim = @enable_ucsim@
59 # Compiling entire program or any subproject
60 # ------------------------------------------
65 main_app: checkconf ucsim_app
67 # Compiling and installing everything and runing test
68 # ---------------------------------------------------
69 install: all installdirs
72 # Deleting all the installed files
73 # --------------------------------
75 rm -f $(DESTDIR)$(bindir)/s51$(EXEEXT)
76 rm -f $(DESTDIR)$(bindir)/savr$(EXEEXT)
77 rm -f $(DESTDIR)$(bindir)/serialview$(EXEEXT)
78 rm -f $(DESTDIR)$(bindir)/portmon$(EXEEXT)
81 # Performing self-test
82 # --------------------
87 # Performing installation test
88 # ----------------------------
92 # Creating installation directories
93 # ---------------------------------
97 # Creating dependencies
98 # ---------------------
101 main.dep: $(ALL_SOURCES) *.h $(srcdir)/*.h
102 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $^ >main.dep
105 include $(srcdir)/clean.mk
113 libutil.a: $(OBJECTS)
114 ar -rcu $*.a $(OBJECTS)
118 ifeq ($(enable_ucsim),yes)
119 ucsim_app: libs ucsim
124 ucsim: $(UCSIM_OBJECTS) $(UCSIM_LIB_FILES)
125 echo $(UCSIM_LIB_FILES)
126 $(CXX) $(CXXFLAGS) -o $@ $< -L$(top_builddir) $(UCSIM_LIBS)
129 $(CXX) $(CXXFLAGS) -o $@ $< -lpthread
131 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
134 # Remaking configuration
135 # ----------------------
137 @if [ -f devel ]; then\
138 $(top_srcdir)/mkecho $(top_builddir) "MAIN.MK checkconf";\
139 $(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\
142 # End of main_in.mk/main.mk