4b09fab80d64af2019e1bf942431fa211388dbd9
[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 $(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         @for pkg in $(PKGS); do\
96           cd $$pkg && $(MAKE) uninstall ; cd ..;\
97         done
98
99 uninstall_gui_api:
100
101
102 # Performing self-test
103 # --------------------
104 check: check_local
105         @for pkg in $(PKGS); do\
106           cd $$pkg && $(MAKE) check ; cd ..;\
107         done
108
109 check_local:
110
111 test: test_local
112         @for pkg in $(PKGS); do\
113           cd $$pkg && $(MAKE) test ; cd ..;\
114         done
115
116 test_local:
117
118
119 # Performing installation test
120 # ----------------------------
121 installcheck: installcheck_gui_api
122         @for pkg in $(PKGS); do\
123           cd $$pkg && $(MAKE) installcheck ; cd ..;\
124         done
125
126 installcheck_gui_api:
127
128
129 # Creating installation directories
130 # ---------------------------------
131 installdirs:
132         @for pkg in $(PKGS); do\
133           cd $$pkg && $(MAKE) installdirs ; cd ..;\
134         done
135
136
137 # Creating dependencies
138 # ---------------------
139 dep: Makefile.dep
140
141 Makefile.dep: $(ALL_SOURCES) *.h
142         $(CXXCPP) -MM $(CPPFLAGS) $(M_OR_MM) $(ALL_SOURCES) >Makefile.dep
143
144 include Makefile.dep
145 include clean.mk
146
147
148 # My rules
149 # --------
150 ucsim_lib: $(PRJDIR)/libguiucsim.a
151
152 $(PRJDIR)/libguiucsim.a: $(OBJECTS) $(UCSIM_OBJECTS)
153         ar -rcu $*.a $(OBJECTS) $(UCSIM_OBJECTS)
154         $(RANLIB) $*.a
155
156 tool_lib: $(PRJDIR)/libguitool.a
157
158 $(PRJDIR)/libguitool.a: $(OBJECTS) $(TOOL_OBJECTS)
159         ar -rcu $*.a $(OBJECTS) $(TOOL_OBJECTS)
160         $(RANLIB) $*.a
161
162 .cc.o:
163         $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
164
165
166 # Remaking configuration
167 # ----------------------
168 checkconf:
169         @if [ -f $(PRJDIR)/devel ]; then\
170           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
171         fi
172
173 # End of gui.src/Makefile