2 # Makefile for TrueType Edit
4 # Author: James Hammons
5 # Copyright: (c) 2006 Underground Software
8 ifeq "$(OSTYPE)" "msys" # Win32
10 SYSTYPE = __GCCWIN32__
16 #ifeq "$(OSTYPE)" "darwin"
17 ifeq "darwin" "$(findstring darwin,$(OSTYPE))" # Should catch both 'darwin' and 'darwin7.0'
19 SYSTYPE = __GCCUNIX__ -D_OSX_
29 MSG = generic Unix/Linux
34 # This is ugly, ugly, ugly. Find a way to fix this crap so it's more unified,
35 # like the SDL based makefiles are... !!! FIX !!! [made initial stab at it]
43 top_builddir = /local/
46 TOOLKIT_LOWERCASE = msw
48 WX_VERSION = $(WX_RELEASE).0
52 # Note that the -MMD flag is what gives us our automagic dependency information (*.d files)
53 # Add -g to compile in debugging information
54 CXXFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -O2 `wx-config --cxxflags` -g
56 LIBS = `wx-config --libs`
68 obj/graphicprimitives.o \
76 BIN_PROGRAM = $(PROGRAM)$(EXESUFFIX)
77 #Need to fix this shit
79 RES_PROGRAM_OBJ = obj/$(PROGRAM)_resources.o
83 BUNDLE = $(BIN_PROGRAM).app/Contents
85 ### Conditionally set variables: ###
87 COND_TOOLKIT_MAC___MACOSX_RESOURCES_p_1 = $(RESCOMP) -d __DARWIN__ -t APPL -d \
88 __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) \
89 $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) -i $(srcdir) -d WXUSINGDLL -i \
90 $(srcdir)/../../samples -i $(top_srcdir)/include -o bombs$(EXEEXT) Carbon.r \
95 all: checkenv message obj $(BIN_PROGRAM) $(__bombs_bundle___depname)
97 @echo "*** Looks like it compiled OK... Give it a whirl!"
104 # Check the compilation environment, barf if not appropriate
108 @echo -n "*** Checking compilation environment... "
109 ifeq "" "$(shell which wx-config)"
112 @echo "It seems that you don't have the wxWidget development libraries installed."
113 @echo "If you have installed them, make sure that the wx-config file is somewhere"
114 @echo "in your path and is executable."
116 #Is there a better way to break out of the makefile?
125 @echo "*** Building TTEdit for $(MSG)..."
129 @echo -n "*** Cleaning out the garbage..."
131 @rm -f $(BIN_PROGRAM)
135 ## This is only done for Win32 at the moment...
138 #$(ICON): res/$(TARGET).rc res/$(TARGET).ico
139 # @echo "*** Processing icon..."
140 # @windres -i res/$(TARGET).rc -o $(ICON) --include-dir=./res
143 # This is only done for Win32 at the moment...
146 $(RES_PROGRAM_OBJ): res/$(PROGRAM).rc res/$(PROGRAM).ico
147 @echo "*** Processing icon..."
148 @$(RESCOMP) -i$< -o$@ --define __WX$(TOOLKIT)__ --include-dir ./res --define WXUSINGDLL --include-dir $(top_srcdir)/include/wx-2.6
151 obj/%.o: $(srcdir)/%.cpp
152 @echo "*** Compiling $<..."
153 @$(CXX) -c -o $@ $(INCS) $(CXXFLAGS) $<
155 $(BIN_PROGRAM): $(OBJECTS) $(RES_PROGRAM_OBJ)
156 @echo "*** Linking it all together..."
157 @$(CXX) -o $@ $(OBJECTS) $(RES_PROGRAM_OBJ) $(LIBS)
161 # Mac OSX bundling shit (figure out how to condense this so it works!)
163 bombs.app/Contents/PkgInfo: bombs$(EXEEXT) $(top_srcdir)/src/mac/carbon/Info.plist.in $(top_srcdir)/src/mac/carbon/wxmac.icns
164 mkdir -p bombs.app/Contents
165 mkdir -p bombs.app/Contents/MacOS
166 mkdir -p bombs.app/Contents/Resources
168 sed -e "s/IDENTIFIER/`echo $(srcdir) | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`/" \
169 -e "s/EXECUTABLE/bombs/" \
170 -e "s/VERSION/$(WX_VERSION)/" \
171 $(top_srcdir)/src/mac/carbon/Info.plist.in >bombs.app/Contents/Info.plist
173 echo -n "APPL????" >bombs.app/Contents/PkgInfo
175 ln -f bombs$(EXEEXT) bombs.app/Contents/MacOS/bombs
177 cp -f $(top_srcdir)/src/mac/carbon/wxmac.icns bombs.app/Contents/Resources/wxmac.icns
179 #bundle: $(_BUNDLE_TGT_REF_DEP)
181 ### Include dependency info, if present:
185 ### No idea what this does
187 #.PHONY: all install uninstall clean distclean bundle