2 # uCsim tlcs.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
22 top_builddir
= @top_builddir@
23 top_srcdir
= @top_srcdir@
25 transform
= @program_transform_name@
27 DEFS
= $(subs
-DHAVE_CONFIG_H
,,@DEFS@
)
28 CPPFLAGS
= @CPPFLAGS@
-I
$(srcdir) -I
$(top_srcdir
) -I
$(top_builddir
) \
29 -I
$(top_srcdir
)/cmd.src
-I
$(top_srcdir
)/sim.src \
30 -I
$(top_srcdir
)/gui.src
32 CFLAGS
= @WALL_FLAG@ @CFLAGS@
-O
$(OPT
)
33 CXXFLAGS
= @WALL_FLAG@ @CXXFLAGS@
-O
$(OPT
)
36 SHAREDLIB
= @SHAREDLIB@
39 LIBS
= -L
$(top_builddir
) -lsim
-lucsimutil
-lguiucsim
-lcmd
-lsim @LIBS@
44 exec_prefix = @
exec_prefix@
48 datarootdir
= @datarootdir@
49 includedir = @
includedir@
51 man1dir = $(mandir)/man1
52 man2dir = $(mandir)/man2
57 OBJECTS_SHARED
= glob.o \
59 inst_block.o inst_cpu_others.o inst_rot_sh.o \
60 inst_jump.o inst_move.o inst_arith.o inst_bit.o
61 OBJECTS_EXE
= s
$(TN
).o
62 OBJECTS
= $(OBJECTS_SHARED
) $(OBJECTS_EXE
)
64 # short/long exe and lib name
66 LEN
= ucsim_
$(TN
)$(EXEEXT
)
67 SONAME
= libucsim_
$(TN
).so
69 enable_dlso
= @enable_dlso@
73 # Compiling entire program or any subproject
74 # ------------------------------------------
75 all: checkconf otherlibs
$(TN
).src
78 # Compiling and installing everything and running test
79 # ---------------------------------------------------
80 install: all installdirs install_shared_lib
81 $(INSTALL
) $(LEN
) $(DESTDIR
)$(bindir)/$(LEN
)
82 $(STRIP
) $(DESTDIR
)$(bindir)/$(LEN
)
83 rm -f
$(DESTDIR
)$(bindir)/$(SEN
)
86 # Deleting all the installed files
87 # --------------------------------
89 rm -f
$(DESTDIR
)$(bindir)/$(SEN
)
90 rm -f
$(DESTDIR
)$(bindir)/$(LEN
)
91 rm -f
$(DESTDIR
)$(libdir)/$(SONAME
)
94 # Performing self-test
95 # --------------------
100 @
$(MAKE
) --no-print-directory
-C
test
103 @
$(MAKE
) --no-print-directory
-C
test baseline
106 # Performing installation test
107 # ----------------------------
111 # Creating installation directories
112 # ---------------------------------
114 test -d
$(DESTDIR
)$(bindir) ||
$(INSTALL
) -d
$(DESTDIR
)$(bindir)
117 # Creating dependencies
118 # ---------------------
121 Makefile.dep
: $(srcdir)/*.
cc $(srcdir)/*.h
122 $(MAKEDEP
) $(CPPFLAGS
) $(filter %.
cc,$^
) >Makefile.dep
124 -include Makefile.dep
125 include $(srcdir)/clean.mk
129 $(TN
).src
: $(LEN
) shared_lib
131 $(LEN
): $(OBJECTS
) $(top_builddir
)/libcmd.a
$(top_builddir
)/libguiucsim.a
$(top_builddir
)/libsim.a
$(top_builddir
)/libucsimutil.a
132 $(CXX
) $(CXXFLAGS
) $(LDFLAGS
) $(OBJECTS
) $(LIBS
) -o
$@
137 ifeq ($(dlso_ok
),yes
)
138 shared_lib
: $(top_builddir
)/$(SONAME
)
139 install_shared_lib
: shared_lib
140 test -d
$(DESTDIR
)$(libdir) ||
$(INSTALL
) -d
$(DESTDIR
)$(libdir)
141 $(INSTALL
) $(top_builddir
)/$(SONAME
) $(DESTDIR
)$(libdir)/$(SONAME
)
144 @
$(top_srcdir
)/mkecho
$(top_builddir
) "No $(TN) shared lib made."
145 @
$(top_srcdir
)/mkecho
$(top_builddir
) "(SHAREDLIB="$(SHAREDLIB
)",dl_ok="$(dl_ok
)",enable_dlso="$(enable_dlso
)")"
149 $(top_builddir
)/$(SONAME
): $(OBJECTS_SHARED
)
150 $(CXX
) -shared
$(LDFLAGS
) $(OBJECTS_SHARED
) -o
$@
152 otherlibs
: $(top_builddir
)/libcmd.a
$(top_builddir
)/libguiucsim.a
$(top_builddir
)/libsim.a
$(top_builddir
)/libucsimutil.a
154 $(top_builddir
)/libcmd.a
:
155 $(MAKE
) -C
$(top_builddir
)/cmd.src
all
157 $(top_builddir
)/libguiucsim.a
:
158 $(MAKE
) -C
$(top_builddir
)/gui.src checkconf ucsim_lib
160 $(top_builddir
)/libsim.a
:
161 $(MAKE
) -C
$(top_builddir
)/sim.src
all
163 $(top_builddir
)/libucsimutil.a
:
164 $(MAKE
) -C
$(top_builddir
) -f main.mk
167 $(CXX
) $(CXXFLAGS
) $(PICOPT
) $(CPPFLAGS
) $(TARGET_ARCH
) -c
$< -o
$@
170 # Remaking configuration
171 # ----------------------
173 @if
[ -f
$(top_builddir
)/devel
]; then\
174 $(MAKE
) -C
$(top_builddir
) -f conf.mk
srcdir="$(srcdir)" top_builddir
="$(top_builddir)" freshconf
;\
177 # End of tlcs.src/Makefile.in