2 # File: Makefile for wxconfigtool
6 # Copyright: (c) Julian Smart
8 # To make absolutely everything:
10 # % mkdir /tmp/wxconfigtool-build
11 # % cd /tmp/wxconfigtool-build
12 # % make -f $(APPDIR)/src/Makefile WXDIR=$(WXDIR) WXBUILDDIR=$(WXBUILDDIR) APPDIR=$(APPDIR) LEVEL=debug full
14 # To make just ConfigTool:
16 # % make ... LEVEL=debug wxconfigtool
18 # To make wxWindows library:
20 # % make ... LEVEL=debug wx
22 # The result will be subdirectories under your /tmp/wxconfigtool-build (or other specified
23 # directory) containing:
25 # wxconfigtool-build-debug/
28 # To make a release version, specify LEVEL=release instead of LEVEL=debug.
31 # Current (build) directory
32 CURRDIR = $(shell pwd)
36 top_builddir = $(WXBUILDDIR)
39 # If we don't specify a location for wxWindows to be
40 # built, use a default.
41 ifeq "$(top_builddir)" ""
42 topbuilddir = $(CURRDIR)/wxwin-build-$(LEVEL)
43 WXBUILDDIR=$(top_builddir)
46 # ConfigTool build directory
47 APPBUILDDIR=$(BUILDDIR)/wxconfigtool-build-$(LEVEL)
49 # StartingBlocks source hierarchy
50 # You have to specify this when invoking make.
51 APPDIR=You_should_override_the_APPDIR_variable
53 # ConfigTool source directory
54 APPSRCDIR=$(APPDIR)/src
56 # ConfigTool include directory
57 APPINCDIR=$(APPDIR)/src
61 -I$(WXDIR)/contrib/include \
68 # Use the small C++ support library
71 # ${top_builddir}/lib/libwx_$(WXTOOLKIT)$(WXDEBUGSUFFIX)_xrc-$(WXVERSION).a
73 PLATFORM_OS=$(shell echo $(OS))
75 ifeq "$(PLATFORM_OS)" "Windows_NT"
79 ARCHITECTURE=$(shell arch)
80 ifeq "$(ARCHITECTURE)" "i686"
88 # @echo $(PLATFORM_OS)
90 ifeq "$(LEVEL)" "debug"
97 # Where to find the wx-config file
98 WXCONFIG=$(WXBUILDDIR)/wx-config $(WXCONFIGFLAGS)
100 ifeq "$(LEVEL)" "debug"
101 WXDEBUGFLAGS=--enable-debug --enable-debug_gdb --enable-debug_cntxt
104 PROGRAM=$(APPBUILDDIR)/wxconfigtool
107 $(APPBUILDDIR)/appsettings.o \
108 $(APPBUILDDIR)/configitem.o \
109 $(APPBUILDDIR)/configitemselector.o \
110 $(APPBUILDDIR)/configtooldoc.o \
111 $(APPBUILDDIR)/configtoolview.o \
112 $(APPBUILDDIR)/configtree.o \
113 $(APPBUILDDIR)/custompropertydialog.o \
114 $(APPBUILDDIR)/htmlparser.o \
115 $(APPBUILDDIR)/mainframe.o \
116 $(APPBUILDDIR)/propeditor.o \
117 $(APPBUILDDIR)/property.o \
118 $(APPBUILDDIR)/settingsdialog.o \
119 $(APPBUILDDIR)/utils.o \
120 $(APPBUILDDIR)/wxconfigtool.o
122 DEPFILES=$(PROGRAM).d
124 ifeq "$(USEDUMMYMAKEPROG)" "1"
125 include $(APPSRCDIR)/makeprog.env
127 include $(top_builddir)/src/makeprog.env
130 # Need to place -lsupc++ at end of libs or we get
131 # link errors. Note the := syntax to prevent a
132 # recursive variable error.
133 LDLIBS:=${LDLIBS} -lsupc++
135 # Only omit C++ libs for economy of size on Unix
136 ifeq "$(WXTOOLKIT)" "msw"
145 mkdir -p $(APPBUILDDIR)
149 # --with-libpng=builtin --with-zlib=builtin --with-libjpeg=builtin
151 @mkdir -p $(WXBUILDDIR) ; \
153 if test ! -f Makefile ; then rm -f *.o *.d ; \
155 $(WXDIR)/configure --disable-shared --enable-gui --enable-log $(WXDEBUGFLAGS) --with-threads --disable-no_rtti --without-sockets --without-odbc --with-libjpeg --with-libpng=builtin --with-zlib=builtin --enable-wave ; \
157 make; cd contrib/src/xrc; make
162 rm -f -r $(WXBUILDDIR)
164 cleanall: cleanapp cleanwx
166 wxconfigtool: mkbuilddir all
168 # Making a binary, RH Linux tarball release using the setup script.
169 # It will put the result in /tmp/wxconfigtool-deliver.
171 echo "#include <stdio.h>" > /tmp/appver.c
172 echo "#include \"symbols.h\"" >> /tmp/appver.c
173 echo "int main() { printf(\"%.2f\", ctVERSION_NUMBER); }" >> /tmp/appver.c
174 cc /tmp/appver.c -I$(APPSRCDIR) -o /tmp/appver
175 chmod a+x $(APPSRCDIR)/../scripts/maketarball.sh
176 $(APPSRCDIR)/../scripts/maketarball.sh $(APPDIR) $(APPBUILDDIR) /tmp/wxconfigtool-deliver `/tmp/appver` # --upx
177 echo The release is in /tmp/wxconfigtool-deliver.
178 # rm -f /tmp/appver /tmp/appver.c
180 # Gives a list of targets
182 @echo "Targets: full, wxconfigtool, wx, cleanall, clean, cleanwx, release"
184 ### File dependencies
188 $(APPBUILDDIR)/wxconfigtool.o: $(APPSRCDIR)/wxconfigtool.cpp $(APPINCDIR)/wxconfigtool.h $(APPSRCDIR)/symbols.h
189 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
191 $(APPBUILDDIR)/appsettings.o: $(APPSRCDIR)/appsettings.cpp $(APPSRCDIR)/appsettings.h $(APPSRCDIR)/symbols.h
192 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
194 $(APPBUILDDIR)/configitem.o: $(APPSRCDIR)/configitem.cpp $(APPSRCDIR)/configitem.h $(APPSRCDIR)/symbols.h
195 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
197 $(APPBUILDDIR)/configitemselector.o: $(APPSRCDIR)/configitemselector.cpp $(APPSRCDIR)/configitemselector.h $(APPSRCDIR)/symbols.h
198 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
200 $(APPBUILDDIR)/configtooldoc.o: $(APPSRCDIR)/configtooldoc.cpp $(APPSRCDIR)/configtooldoc.h $(APPSRCDIR)/symbols.h
201 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
203 $(APPBUILDDIR)/configtoolview.o: $(APPSRCDIR)/configtoolview.cpp $(APPSRCDIR)/configtoolview.h $(APPSRCDIR)/symbols.h
204 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
206 $(APPBUILDDIR)/configtree.o: $(APPSRCDIR)/configtree.cpp $(APPSRCDIR)/configtree.h $(APPSRCDIR)/symbols.h
207 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
209 $(APPBUILDDIR)/custompropertydialog.o: $(APPSRCDIR)/custompropertydialog.cpp $(APPSRCDIR)/custompropertydialog.h $(APPSRCDIR)/symbols.h
210 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
212 $(APPBUILDDIR)/htmlparser.o: $(APPSRCDIR)/htmlparser.cpp $(APPSRCDIR)/htmlparser.h $(APPSRCDIR)/symbols.h
213 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
215 $(APPBUILDDIR)/mainframe.o: $(APPSRCDIR)/mainframe.cpp $(APPINCDIR)/mainframe.h $(APPSRCDIR)/symbols.h
216 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
218 $(APPBUILDDIR)/propeditor.o: $(APPSRCDIR)/propeditor.cpp $(APPINCDIR)/propeditor.h $(APPSRCDIR)/symbols.h
219 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
221 $(APPBUILDDIR)/property.o: $(APPSRCDIR)/property.cpp $(APPINCDIR)/property.h $(APPSRCDIR)/symbols.h
222 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
224 $(APPBUILDDIR)/settingsdialog.o: $(APPSRCDIR)/settingsdialog.cpp $(APPINCDIR)/settingsdialog.h $(APPSRCDIR)/symbols.h
225 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
227 $(APPBUILDDIR)/utils.o: $(APPSRCDIR)/utils.cpp $(APPINCDIR)/utils.h $(APPSRCDIR)/symbols.h
228 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
230 $(APPBUILDDIR)/wxconfigtool_resources.o: $(APPSRCDIR)/wxconfigtool.rc
231 $(RESCOMP) -i $< -o $@ $(RESFLAGS) --include-dir $(APPSRCDIR)