b48a3806cad9d3e2cd559092de1500115666a0ed
[fw/sdcc] / sim / ucsim / gui.src / Makefile.in
1 #
2 # uCsim gui.src/Makefile
3 #
4 # (c) Drotos Daniel, Talker Bt. 1999
5 #
6
7 SHELL           = /bin/sh
8 CXX             = @CXX@
9 CPP             = @CPP@
10 CXXCPP          = @CXXCPP@
11 RANLIB          = @RANLIB@
12 INSTALL         = @INSTALL@
13
14 top_builddir    = @top_builddir@
15 top_srcdir      = @top_srcdir@
16
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
22 M_OR_MM         = @M_OR_MM@
23
24 LIBS            = @LIBS@ @CURSES_LIBS@ -L$(top_builddir)
25
26 curses_ok       = @curses_ok@
27
28 prefix          = @prefix@
29 exec_prefix     = @exec_prefix@
30 bindir          = @bindir@
31 libdir          = @libdir@
32 datadir         = @datadir@
33 datarootdir     = @datarootdir@
34 includedir      = @includedir@
35 mandir          = @mandir@
36 man1dir         = $(mandir)/man1
37 man2dir         = $(mandir)/man2
38 infodir         = @infodir@
39 srcdir          = @srcdir@
40 VPATH           = @srcdir@
41
42 enable_serio    = @enable_serio@
43 PKGS            =
44 ifeq ($(enable_serio),yes)
45 SERIO_PKG       = serio.src
46 else
47 SERIO_PKG       =
48 endif
49 CURSES_PKGS     = $(SERIO_PKG)
50
51 # Common code
52 OBJECTS         = rec.o
53 SOURCES         = $(patsubst %.o,%.cc,$(OBJECTS))
54
55 # uCsim only
56 UCSIM_OBJECTS   = gui.o if.o
57 UCSIM_SOURCES   = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
58
59 # Tool only
60 TOOL_OBJECTS    =
61 TOOL_SOURCES    = $(patsubst %.o,%.cc,$(TOOL_OBJECTS))
62
63 ALL_SOURCES     = $(SOURCES) $(UCSIM_SOURCES) $(TOOL_SOURCES)
64
65
66 # Compiling entire program or any subproject
67 # ------------------------------------------
68 all: gui.src
69
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 ;\
74         done
75 endif
76 #       @for pkg in $(PKGS); do\
77 #         $(MAKE) -C $$pkg $$pkg ;\
78 #       done
79
80 gui_api: ucsim_lib tool_lib
81
82
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 ..;\
89         done
90 endif
91
92 install_gui_api:
93
94
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 ..;\
101         done
102 endif
103
104 uninstall_gui_api:
105
106
107 # Performing self-test
108 # --------------------
109 check: check_local
110         @for pkg in $(CURSES_PKGS); do\
111           $(MAKE) -C $$pkg check ; cd ..;\
112         done
113
114 check_local:
115
116 test: test_local
117         @for pkg in $(CURSES_PKGS); do\
118           $(MAKE) -C $$pkg test ; cd ..;\
119         done
120
121 test_local:
122
123
124 # Performing installation test
125 # ----------------------------
126 installcheck: installcheck_gui_api
127         @for pkg in $(CURSES_PKGS); do\
128           $(MAKE) -C $$pkg installcheck ; cd ..;\
129         done
130
131 installcheck_gui_api:
132
133
134 # Creating installation directories
135 # ---------------------------------
136 installdirs:
137         @for pkg in $(CURSES_PKGS); do\
138           $(MAKE) -C $$pkg installdirs ; cd ..;\
139         done
140
141
142 # Creating dependencies
143 # ---------------------
144 dep: Makefile.dep
145
146 Makefile.dep: $(ALL_SOURCES) $(srcdir)/*.h
147         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
148
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 \
152                                    checkconf \
153                                    clean_local clean distclean_local \
154                                    distclean mostlyclean realclean)" ""
155   include Makefile.dep
156 endif
157 include $(srcdir)/clean.mk
158
159
160 # My rules
161 # --------
162 ucsim_lib: $(top_builddir)/libguiucsim.a
163
164 $(top_builddir)/libguiucsim.a: $(OBJECTS) $(UCSIM_OBJECTS)
165         ar -rcu $*.a $(OBJECTS) $(UCSIM_OBJECTS)
166         $(RANLIB) $*.a
167
168 tool_lib: $(top_builddir)/libguitool.a
169
170 $(top_builddir)/libguitool.a: $(OBJECTS) $(TOOL_OBJECTS)
171         ar -rcu $*.a $(OBJECTS) $(TOOL_OBJECTS)
172         $(RANLIB) $*.a
173
174 .cc.o:
175         $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
176
177
178 # Remaking configuration
179 # ----------------------
180 checkconf:
181         @if [ -f $(top_builddir)/devel ]; then\
182           $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
183         fi
184
185 # End of gui.src/Makefile