2 # uCsim gui.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1999
14 top_builddir = @top_builddir@
15 top_srcdir = @top_srcdir@
17 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
18 CPPFLAGS = @CPPFLAGS@ -I$(srcdir) -I$(top_builddir) -I$(top_srcdir) \
19 -I$(top_srcdir)/sim.src -I$(top_srcdir)/cmd.src
20 CFLAGS = @CFLAGS@ -Wall
21 CXXFLAGS = @CXXFLAGS@ -Wall
24 LIBS = @LIBS@ @CURSES_LIBS@ -L$(top_builddir)
26 curses_ok = @curses_ok@
29 exec_prefix = @exec_prefix@
33 datarootdir = @datarootdir@
34 includedir = @includedir@
36 man1dir = $(mandir)/man1
37 man2dir = $(mandir)/man2
42 enable_serio = @enable_serio@
44 ifeq ($(enable_serio),yes)
49 CURSES_PKGS = $(SERIO_PKG)
53 SOURCES = $(patsubst %.o,%.cc,$(OBJECTS))
56 UCSIM_OBJECTS = gui.o if.o
57 UCSIM_SOURCES = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
61 TOOL_SOURCES = $(patsubst %.o,%.cc,$(TOOL_OBJECTS))
63 ALL_SOURCES = $(SOURCES) $(UCSIM_SOURCES) $(TOOL_SOURCES)
66 # Compiling entire program or any subproject
67 # ------------------------------------------
70 gui.src: checkconf gui_api
71 ifeq ($(curses_ok),yes)
72 @for pkg in dummy $(CURSES_PKGS); do\
73 if test -f $$pkg/Makefile; then $(MAKE) -C $$pkg $$pkg; else : ; fi ;\
76 # @for pkg in $(PKGS); do\
77 # $(MAKE) -C $$pkg $$pkg ;\
80 gui_api: ucsim_lib tool_lib
83 # Compiling and installing everything and runing test
84 # ---------------------------------------------------
85 install: install_gui_api
86 ifeq ($(curses_ok),yes)
87 @for pkg in $(CURSES_PKGS); do\
88 $(MAKE) -C $$pkg install ; cd ..;\
95 # Deleting all the installed files
96 # --------------------------------
97 uninstall: uninstall_gui_api
98 ifeq ($(curses_ok),yes)
99 @for pkg in $(CURSES_PKGS); do\
100 $(MAKE) -C $$pkg uninstall ; cd ..;\
107 # Performing self-test
108 # --------------------
110 @for pkg in $(CURSES_PKGS); do\
111 $(MAKE) -C $$pkg check ; cd ..;\
117 @for pkg in $(CURSES_PKGS); do\
118 $(MAKE) -C $$pkg test ; cd ..;\
124 # Performing installation test
125 # ----------------------------
126 installcheck: installcheck_gui_api
127 @for pkg in $(CURSES_PKGS); do\
128 $(MAKE) -C $$pkg installcheck ; cd ..;\
131 installcheck_gui_api:
134 # Creating installation directories
135 # ---------------------------------
137 @for pkg in $(CURSES_PKGS); do\
138 $(MAKE) -C $$pkg installdirs ; cd ..;\
142 # Creating dependencies
143 # ---------------------
146 Makefile.dep: $(ALL_SOURCES) $(srcdir)/*.h
147 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
149 # don't include Makefile.dep for the listed targets:
150 ifeq "$(findstring $(MAKECMDGOALS),uninstall uninstall_gui_api \
151 check check_local test test_local \
153 clean_local clean distclean_local \
154 distclean mostlyclean realclean)" ""
157 include $(srcdir)/clean.mk
162 ucsim_lib: $(top_builddir)/libguiucsim.a
164 $(top_builddir)/libguiucsim.a: $(OBJECTS) $(UCSIM_OBJECTS)
165 ar -rcu $*.a $(OBJECTS) $(UCSIM_OBJECTS)
168 tool_lib: $(top_builddir)/libguitool.a
170 $(top_builddir)/libguitool.a: $(OBJECTS) $(TOOL_OBJECTS)
171 ar -rcu $*.a $(OBJECTS) $(TOOL_OBJECTS)
175 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
178 # Remaking configuration
179 # ----------------------
181 @if [ -f $(top_builddir)/devel ]; then\
182 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
185 # End of gui.src/Makefile