4 # (c) Drotos Daniel, Talker Bt. 1997,99
21 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
22 # FIXME: -Imcs51 must be removed!!!
23 CPPFLAGS = @CPPFLAGS@ -I$(PRJDIR) -I$(PRJDIR)/$(SIMDIR) \
24 -I$(CMDDIR) -I$(GUIDIR)
25 CFLAGS = @CFLAGS@ -I$(PRJDIR) -Wall
26 CXXFLAGS = @CXXFLAGS@ -I$(PRJDIR) -Wall
31 LIB_LIST = util cmd sim
32 UCSIM_LIBS = -Wl,--start-group $(patsubst %,-l%,$(LIB_LIST)) -Wl,--end-group
33 UCSIM_LIB_FILES = $(patsubst %,lib%.a,$(LIB_LIST))
36 exec_prefix = @exec_prefix@
40 includedir = @includedir@
42 man1dir = $(mandir)/man1
43 man2dir = $(mandir)/man2
47 OBJECTS = pobj.o globals.o utils.o error.o app.o option.o
48 SOURCES = $(patsubst %.o,%.cc,$(OBJECTS))
49 UCSIM_OBJECTS = ucsim.o
50 UCSIM_SOURCES = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
51 ALL_SOURCES = $(SOURCES) $(UCSIM_SOURCES)
53 enable_ucsim = @enable_ucsim@
56 # Compiling entire program or any subproject
57 # ------------------------------------------
62 main_app: checkconf ucsim_app
64 # Compiling and installing everything and runing test
65 # ---------------------------------------------------
66 install: all installdirs
69 # Deleting all the installed files
70 # --------------------------------
72 rm -f $(DESTDIR)$(bindir)/s51$(EXEEXT)
73 rm -f $(DESTDIR)$(bindir)/savr$(EXEEXT)
74 rm -f $(DESTDIR)$(bindir)/serialview$(EXEEXT)
75 rm -f $(DESTDIR)$(bindir)/portmon$(EXEEXT)
78 # Performing self-test
79 # --------------------
84 # Performing installation test
85 # ----------------------------
89 # Creating installation directories
90 # ---------------------------------
94 # Creating dependencies
95 # ---------------------
98 main.dep: $(ALL_SOURCES) *.h
99 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(ALL_SOURCES) >main.dep
110 libutil.a: $(OBJECTS)
111 ar -rcu $*.a $(OBJECTS)
115 ifeq ($(enable_ucsim),yes)
116 ucsim_app: libs ucsim
121 ucsim: $(UCSIM_OBJECTS) $(UCSIM_LIB_FILES)
122 echo $(UCSIM_LIB_FILES)
123 $(CXX) $(CXXFLAGS) -o $@ $< -L$(PRJDIR) $(UCSIM_LIBS)
126 $(CXX) $(CXXFLAGS) -o $@ $< -lpthread
128 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
131 # Remaking configuration
132 # ----------------------
134 @if [ -f devel ]; then\
135 $(PRJDIR)/mkecho $(PRJDIR) "MAIN.MK checkconf";\
136 $(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\
139 # End of main_in.mk/main.mk