4 # (c) Drotos Daniel, Talker Bt. 1997,99
19 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
20 # FIXME: -Imcs51 must be removed!!!
21 CPPFLAGS = @CPPFLAGS@ -I$(PRJDIR) -I$(PRJDIR)/$(SIMDIR)
22 CFLAGS = @CFLAGS@ -I$(PRJDIR) -Wall
23 CXXFLAGS = @CXXFLAGS@ -I$(PRJDIR) -Wall
26 LIB_LIST = sim cmd sim util
27 UCSIM_LIBS = $(patsubst %,-l%,$(LIB_LIST))
28 UCSIM_LIB_FILES = $(patsubst %,lib%.a,$(LIB_LIST))
32 exec_prefix = @exec_prefix@
36 includedir = @includedir@
38 man1dir = $(mandir)/man1
39 man2dir = $(mandir)/man2
43 OBJECTS = pobj.o globals.o utils.o
44 SOURCES = $(patsubst %.o,%.cc,$(OBJECTS))
45 UCSIM_OBJECTS = ucsim.o
46 UCSIM_SOURCES = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
47 ALL_SOURCES = $(SOURCES) $(UCSIM_SOURCES)
50 # Compiling entire program or any subproject
51 # ------------------------------------------
56 main_app: checkconf ucsim_app
58 # Compiling and installing everything and runing test
59 # ---------------------------------------------------
60 install: all installdirs
63 # Deleting all the installed files
64 # --------------------------------
68 rm -f $(bindir)/serialview
69 rm -f $(bindir)/portmon
72 # Performing self-test
73 # --------------------
77 # Performing installation test
78 # ----------------------------
82 # Creating installation directories
83 # ---------------------------------
87 # Creating dependencies
88 # ---------------------
91 main.dep: $(ALL_SOURCES) *.h
92 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(ALL_SOURCES) >main.dep
103 libutil.a: $(OBJECTS)
104 $(AR) -rcu $*.a $(OBJECTS)
107 ucsim_app: libs ucsim
109 ucsim: $(UCSIM_OBJECTS) $(UCSIM_LIB_FILES)
110 $(CXX) $(CXXFLAGS) -o $@ $< -L$(PRJDIR) $(UCSIM_LIBS) $(LIBS)
113 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
126 # Remaking configuration
127 # ----------------------
129 @if [ -f devel ]; then\
130 echo "MAIN.MK checkconf";\
131 $(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\
134 # End of main_in.mk/main.mk