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 debuggin information
54 CXXFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -O2 `wx-config --cxxflags` -g
56 LIBS = `wx-config --libs`
73 BIN_PROGRAM = $(PROGRAM)$(EXESUFFIX)
74 #Need to fix this shit
76 RES_PROGRAM_OBJ = obj/$(PROGRAM)_resources.o
80 BUNDLE = $(BIN_PROGRAM).app/Contents
82 ### Conditionally set variables: ###
84 COND_TOOLKIT_MAC___MACOSX_RESOURCES_p_1 = $(RESCOMP) -d __DARWIN__ -t APPL -d \
85 __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) \
86 $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) -i $(srcdir) -d WXUSINGDLL -i \
87 $(srcdir)/../../samples -i $(top_srcdir)/include -o bombs$(EXEEXT) Carbon.r \
92 all: checkenv message obj $(BIN_PROGRAM) $(__bombs_bundle___depname)
94 @echo "*** Looks like it compiled OK... Give it a whirl!"
101 # Check the compilation environment, barf if not appropriate
105 @echo -n "*** Checking compilation environment... "
106 ifeq "" "$(shell which wx-config)"
109 @echo "It seems that you don't have the wxWidget development libraries installed."
110 @echo "If you have installed them, make sure that the wx-config file is somewhere"
111 @echo "in your path and is executable."
113 #Is there a better way to break out of the makefile?
122 @echo "*** Building TTEdit for $(MSG)..."
126 @echo -n "*** Cleaning out the garbage..."
128 @rm -f $(BIN_PROGRAM)
132 ## This is only done for Win32 at the moment...
135 #$(ICON): res/$(TARGET).rc res/$(TARGET).ico
136 # @echo "*** Processing icon..."
137 # @windres -i res/$(TARGET).rc -o $(ICON) --include-dir=./res
140 # This is only done for Win32 at the moment...
143 $(RES_PROGRAM_OBJ): res/$(PROGRAM).rc res/$(PROGRAM).ico
144 @echo "*** Processing icon..."
145 @$(RESCOMP) -i$< -o$@ --define __WX$(TOOLKIT)__ --include-dir ./res --define WXUSINGDLL --include-dir $(top_srcdir)/include/wx-2.6
148 obj/%.o: $(srcdir)/%.cpp
149 @echo "*** Compiling $<..."
150 @$(CXX) -c -o $@ $(INCS) $(CXXFLAGS) $<
152 $(BIN_PROGRAM): $(OBJECTS) $(RES_PROGRAM_OBJ)
153 @echo "*** Linking it all together..."
154 @$(CXX) -o $@ $(OBJECTS) $(RES_PROGRAM_OBJ) $(LIBS)
158 # Mac OSX bundling shit (figure out how to condense this so it works!)
160 bombs.app/Contents/PkgInfo: bombs$(EXEEXT) $(top_srcdir)/src/mac/carbon/Info.plist.in $(top_srcdir)/src/mac/carbon/wxmac.icns
161 mkdir -p bombs.app/Contents
162 mkdir -p bombs.app/Contents/MacOS
163 mkdir -p bombs.app/Contents/Resources
165 sed -e "s/IDENTIFIER/`echo $(srcdir) | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`/" \
166 -e "s/EXECUTABLE/bombs/" \
167 -e "s/VERSION/$(WX_VERSION)/" \
168 $(top_srcdir)/src/mac/carbon/Info.plist.in >bombs.app/Contents/Info.plist
170 echo -n "APPL????" >bombs.app/Contents/PkgInfo
172 ln -f bombs$(EXEEXT) bombs.app/Contents/MacOS/bombs
174 cp -f $(top_srcdir)/src/mac/carbon/wxmac.icns bombs.app/Contents/Resources/wxmac.icns
176 #bundle: $(_BUNDLE_TGT_REF_DEP)
178 ### Include dependency info, if present:
182 ### No idea what this does
184 #.PHONY: all install uninstall clean distclean bundle