2 # uCsim m6800.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
21 top_builddir
= @top_builddir@
22 top_srcdir
= @top_srcdir@
24 transform
= @program_transform_name@
26 DEFS
= $(subs
-DHAVE_CONFIG_H
,,@DEFS@
)
27 CPPFLAGS
= @CPPFLAGS@
-I
$(srcdir) -I
$(top_srcdir
) -I
$(top_builddir
) \
28 -I
$(top_srcdir
)/cmd.src
-I
$(top_srcdir
)/sim.src \
29 -I
$(top_srcdir
)/gui.src
-I
$(top_srcdir
)/motorola.src
31 CFLAGS
= @WALL_FLAG@ @CFLAGS@
-O
$(OPT
)
32 CXXFLAGS
= @WALL_FLAG@ @CXXFLAGS@
-O
$(OPT
)
35 SHAREDLIB
= @SHAREDLIB@
38 LIBS
= -L
$(top_builddir
) -lmotorola
-lsim
-lucsimutil
-lguiucsim
-lcmd
-lsim @LIBS@
43 exec_prefix = @
exec_prefix@
47 datarootdir
= @datarootdir@
48 includedir = @
includedir@
50 man1dir = $(mandir)/man1
51 man2dir = $(mandir)/man2
56 OBJECTS_SHARED
= sim
$(TN
).o
$(TN
).o glob.o irq.o \
57 inst.o ialu.o ibranch.o imove.o
59 OBJECTS_EXE
= s
$(TN
).o
60 OBJECTS
= $(OBJECTS_SHARED
) $(OBJECTS_EXE
)
62 # short/long exe and lib name
64 LEN
= ucsim_
$(TN
)$(EXEEXT
)
65 SONAME
= libucsim_
$(TN
).so
67 enable_dlso
= @enable_dlso@
74 # Compiling entire program or any subproject
75 # ------------------------------------------
76 all: checkconf otherlibs
$(TN
).src
79 # Compiling and installing everything and running test
80 # ---------------------------------------------------
81 install: all installdirs install_shared_lib
82 $(INSTALL
) $(LEN
) $(DESTDIR
)$(bindir)/$(LEN
)
83 $(STRIP
) $(DESTDIR
)$(bindir)/$(LEN
)
84 rm -f
$(DESTDIR
)$(bindir)/$(SEN
)
87 # Deleting all the installed files
88 # --------------------------------
90 rm -f
$(DESTDIR
)$(bindir)/$(SEN
)
91 rm -f
$(DESTDIR
)$(bindir)/$(LEN
)
92 rm -f
$(DESTDIR
)$(libdir)/$(SONAME
)
95 # Performing self-test
96 # --------------------
101 @
$(MAKE
) --no-print-directory
-C
test
104 @
$(MAKE
) --no-print-directory
-C
test baseline
107 # Performing installation test
108 # ----------------------------
112 # Creating installation directories
113 # ---------------------------------
115 test -d
$(DESTDIR
)$(bindir) ||
$(INSTALL
) -d
$(DESTDIR
)$(bindir)
118 # Creating dependencies
119 # ---------------------
122 Makefile.dep
: $(srcdir)/*.
cc $(srcdir)/*.h
123 $(MAKEDEP
) $(CPPFLAGS
) $(filter %.
cc,$^
) >Makefile.dep
125 -include Makefile.dep
126 include $(srcdir)/clean.mk
132 $(TN
).src
: $(LEN
) shared_lib
$(TN
)lib
134 $(LEN
): $(OBJECTS
) $(top_builddir
)/libcmd.a
$(top_builddir
)/libguiucsim.a
$(top_builddir
)/libsim.a
$(top_builddir
)/libucsimutil.a
$(top_builddir
)/libmotorola.a
135 $(CXX
) $(CXXFLAGS
) $(LDFLAGS
) $(OBJECTS
) $(LIBS
) -o
$@
140 $(TN
)lib
: $(top_builddir
)/lib
$(TN
).a
142 $(top_builddir
)/lib
$(TN
).a
: $(OBJECTS_SHARED
)
143 $(AR
) -rc
$@
$(OBJECTS_SHARED
)
146 ifeq ($(dlso_ok
),yes
)
147 shared_lib
: $(top_builddir
)/$(SONAME
)
148 install_shared_lib
: shared_lib
149 test -d
$(DESTDIR
)$(libdir) ||
$(INSTALL
) -d
$(DESTDIR
)$(libdir)
150 $(INSTALL
) $(top_builddir
)/$(SONAME
) $(DESTDIR
)$(libdir)/$(SONAME
)
153 @
$(top_srcdir
)/mkecho
$(top_builddir
) "No $(TN) shared lib made."
154 @
$(top_srcdir
)/mkecho
$(top_builddir
) "(SHAREDLIB="$(SHAREDLIB
)",dl_ok="$(dl_ok
)",enable_dlso="$(enable_dlso
)")"
158 $(top_builddir
)/$(SONAME
): $(OBJECTS_SHARED
)
159 $(CXX
) -shared
$(LDFLAGS
) $(OBJECTS_SHARED
) -o
$@
161 otherlibs
: $(top_builddir
)/libcmd.a
$(top_builddir
)/libguiucsim.a
$(top_builddir
)/libsim.a
$(top_builddir
)/libucsimutil.a
$(top_builddir
)/libmotorola.a
163 $(top_builddir
)/libcmd.a
:
164 $(MAKE
) -C
$(top_builddir
)/cmd.src
all
166 $(top_builddir
)/libguiucsim.a
:
167 $(MAKE
) -C
$(top_builddir
)/gui.src checkconf ucsim_lib
169 $(top_builddir
)/libsim.a
:
170 $(MAKE
) -C
$(top_builddir
)/sim.src
all
172 $(top_builddir
)/libucsimutil.a
:
173 $(MAKE
) -C
$(top_builddir
) -f main.mk
175 $(top_builddir
)/libmotorola.a
:
176 $(MAKE
) -C
$(top_builddir
)/motorola.src
all
179 $(CXX
) $(CXXFLAGS
) $(PICOPT
) $(CPPFLAGS
) $(TARGET_ARCH
) -c
$< -o
$@
182 $(M6800ASM
) -l
$< -o
$@
-e
$<.lst
185 # Remaking configuration
186 # ----------------------
188 @if
[ -f
$(top_builddir
)/devel
]; then\
189 $(MAKE
) -C
$(top_builddir
) -f conf.mk
srcdir="$(srcdir)" top_builddir
="$(top_builddir)" freshconf
;\
192 # End of m6800.src/Makefile.in