* sdcc.spec: updated
[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 PRJDIR          = ..
15
16 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
17 CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
18                   -I$(PRJDIR)/sim.src -I$(PRJDIR)/cmd.src
19 CFLAGS          = @CFLAGS@ -Wall
20 CXXFLAGS        = @CXXFLAGS@ -Wall
21 M_OR_MM         = @M_OR_MM@
22
23 LIBS            = @LIBS@ @CURSES_LIBS@ -L$(PRJDIR)
24
25 curses_ok       = @curses_ok@
26
27 prefix          = @prefix@
28 exec_prefix     = @exec_prefix@
29 bindir          = @bindir@
30 libdir          = @libdir@
31 datadir         = @datadir@
32 includedir      = @includedir@
33 mandir          = @mandir@
34 man1dir         = $(mandir)/man1
35 man2dir         = $(mandir)/man2
36 infodir         = @infodir@
37 srcdir          = @srcdir@
38
39 enable_serio    = @enable_serio@
40 PKGS            =
41 ifeq ($(enable_serio),yes)
42 SERIO_PKG       = serio.src
43 else
44 SERIO_PKG       =
45 endif
46 CURSES_PKGS     = $(SERIO_PKG)
47
48 # Common code
49 OBJECTS         = rec.o
50 SOURCES         = $(patsubst %.o,%.cc,$(OBJECTS))
51
52 # uCsim only
53 UCSIM_OBJECTS   = gui.o if.o
54 UCSIM_SOURCES   = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
55
56 # Tool only
57 TOOL_OBJECTS    =
58 TOOL_SOURCES    = $(patsubst %.o,%.cc,$(TOOL_OBJECTS))
59
60 ALL_SOURCES     = $(SOURCES) $(UCSIM_SOURCES) $(TOOL_SOURCES)
61
62
63 # Compiling entire program or any subproject
64 # ------------------------------------------
65 all: gui.src
66
67 gui.src: checkconf gui_api
68 ifeq ($(curses_ok),yes)
69         @for pkg in dummy $(CURSES_PKGS); do\
70           if test -d $$pkg; then $(MAKE) -C $$pkg $$pkg; else : ; fi ;\
71         done
72 endif
73 #       @for pkg in $(PKGS); do\
74 #         $(MAKE) -C $$pkg $$pkg ;\
75 #       done
76
77 gui_api: ucsim_lib tool_lib
78
79
80 # Compiling and installing everything and runing test
81 # ---------------------------------------------------
82 install: install_gui_api
83 ifeq ($(curses_ok),yes)
84         @for pkg in $(CURSES_PKGS); do\
85           cd $$pkg && $(MAKE) install ; cd ..;\
86         done
87 endif
88
89 install_gui_api:
90
91
92 # Deleting all the installed files
93 # --------------------------------
94 uninstall: uninstall_gui_api
95 ifeq ($(curses_ok),yes)
96         @for pkg in $(CURSES_PKGS); do\
97           cd $$pkg && $(MAKE) uninstall ; cd ..;\
98         done
99 endif
100
101 uninstall_gui_api:
102
103
104 # Performing self-test
105 # --------------------
106 check: check_local
107         @for pkg in $(CURSES_PKGS); do\
108           cd $$pkg && $(MAKE) check ; cd ..;\
109         done
110
111 check_local:
112
113 test: test_local
114         @for pkg in $(CURSES_PKGS); do\
115           cd $$pkg && $(MAKE) test ; cd ..;\
116         done
117
118 test_local:
119
120
121 # Performing installation test
122 # ----------------------------
123 installcheck: installcheck_gui_api
124         @for pkg in $(CURSES_PKGS); do\
125           cd $$pkg && $(MAKE) installcheck ; cd ..;\
126         done
127
128 installcheck_gui_api:
129
130
131 # Creating installation directories
132 # ---------------------------------
133 installdirs:
134         @for pkg in $(CURSES_PKGS); do\
135           cd $$pkg && $(MAKE) installdirs ; cd ..;\
136         done
137
138
139 # Creating dependencies
140 # ---------------------
141 dep: Makefile.dep
142
143 Makefile.dep: $(ALL_SOURCES) *.h
144         $(CXXCPP) -MM $(CPPFLAGS) $(M_OR_MM) $(ALL_SOURCES) >Makefile.dep
145
146 include Makefile.dep
147 include clean.mk
148
149
150 # My rules
151 # --------
152 ucsim_lib: $(PRJDIR)/libguiucsim.a
153
154 $(PRJDIR)/libguiucsim.a: $(OBJECTS) $(UCSIM_OBJECTS)
155         ar -rcu $*.a $(OBJECTS) $(UCSIM_OBJECTS)
156         $(RANLIB) $*.a
157
158 tool_lib: $(PRJDIR)/libguitool.a
159
160 $(PRJDIR)/libguitool.a: $(OBJECTS) $(TOOL_OBJECTS)
161         ar -rcu $*.a $(OBJECTS) $(TOOL_OBJECTS)
162         $(RANLIB) $*.a
163
164 .cc.o:
165         $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
166
167
168 # Remaking configuration
169 # ----------------------
170 checkconf:
171         @if [ -f $(PRJDIR)/devel ]; then\
172           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
173         fi
174
175 # End of gui.src/Makefile