# # Makefile for TrueType Edit # # Author: James Hammons # Copyright: (c) 2006 Underground Software # ifeq "$(OSTYPE)" "msys" # Win32 SYSTYPE = __GCCWIN32__ EXESUFFIX = .exe ICON = obj/icon.o MSG = Win32 on MinGW else #ifeq "$(OSTYPE)" "darwin" ifeq "darwin" "$(findstring darwin,$(OSTYPE))" # Should catch both 'darwin' and 'darwin7.0' SYSTYPE = __GCCUNIX__ -D_OSX_ EXESUFFIX = ICON = MSG = Mac OS X else # *nix SYSTYPE = __GCCUNIX__ EXESUFFIX = ICON = MSG = generic Unix/Linux endif endif # This is ugly, ugly, ugly. Find a way to fix this crap so it's more unified, # like the SDL based makefiles are... !!! FIX !!! [made initial stab at it] ### Variables: ### #EXEEXT = .exe RESCOMP = windres srcdir = ./src top_srcdir = /local top_builddir = /local/ CXX = g++ TOOLKIT = MSW TOOLKIT_LOWERCASE = msw WX_RELEASE = 2.6 WX_VERSION = $(WX_RELEASE).0 # This is OK # Note that the -MMD flag is what gives us our automagic dependency information (*.d files) # Add -g to compile in debugging information CXXFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -O2 `wx-config --cxxflags` -g INCS = -I. LIBS = `wx-config --libs` PROGRAM = ttedit # KO si sihT OBJECTS = \ obj/charnames.o \ obj/charwindow.o \ obj/debug.o \ obj/editwindow.o \ obj/glyphpoints.o \ obj/graphicprimitives.o \ obj/registry.o \ obj/toolwindow.o \ obj/ttf.o \ obj/vector.o \ obj/$(PROGRAM).o \ $(ICON) BIN_PROGRAM = $(PROGRAM)$(EXESUFFIX) #Need to fix this shit ifneq "" "$(ICON)" RES_PROGRAM_OBJ = obj/$(PROGRAM)_resources.o else RES_PROGRAM_OBJ = endif BUNDLE = $(BIN_PROGRAM).app/Contents ### Conditionally set variables: ### COND_TOOLKIT_MAC___MACOSX_RESOURCES_p_1 = $(RESCOMP) -d __DARWIN__ -t APPL -d \ __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) \ $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) -i $(srcdir) -d WXUSINGDLL -i \ $(srcdir)/../../samples -i $(top_srcdir)/include -o bombs$(EXEEXT) Carbon.r \ sample.r ### Targets: ### all: checkenv message obj $(BIN_PROGRAM) $(__bombs_bundle___depname) @echo @echo "*** Looks like it compiled OK... Give it a whirl!" obj: @mkdir obj #install: all # Check the compilation environment, barf if not appropriate checkenv: @echo @echo -n "*** Checking compilation environment... " ifeq "" "$(shell which wx-config)" @echo @echo @echo "It seems that you don't have the wxWidget development libraries installed." @echo "If you have installed them, make sure that the wx-config file is somewhere" @echo "in your path and is executable." @echo #Is there a better way to break out of the makefile? # @break @breakola! else @echo "OK" endif message: # @echo @echo "*** Building TTEdit for $(MSG)..." @echo clean: @echo -n "*** Cleaning out the garbage..." @rm -rf ./obj @rm -f $(BIN_PROGRAM) # rm -rf bombs.app @echo "done!" ## This is only done for Win32 at the moment... # #ifneq "" "$(ICON)" #$(ICON): res/$(TARGET).rc res/$(TARGET).ico # @echo "*** Processing icon..." # @windres -i res/$(TARGET).rc -o $(ICON) --include-dir=./res #endif # This is only done for Win32 at the moment... ifneq "" "$(ICON)" $(RES_PROGRAM_OBJ): res/$(PROGRAM).rc res/$(PROGRAM).ico @echo "*** Processing icon..." @$(RESCOMP) -i$< -o$@ --define __WX$(TOOLKIT)__ --include-dir ./res --define WXUSINGDLL --include-dir $(top_srcdir)/include/wx-2.6 endif obj/%.o: $(srcdir)/%.cpp @echo "*** Compiling $<..." @$(CXX) -c -o $@ $(INCS) $(CXXFLAGS) $< $(BIN_PROGRAM): $(OBJECTS) $(RES_PROGRAM_OBJ) @echo "*** Linking it all together..." @$(CXX) -o $@ $(OBJECTS) $(RES_PROGRAM_OBJ) $(LIBS) # $(_mac_rezcmd) # $(_mac_setfilecmd) # Mac OSX bundling shit (figure out how to condense this so it works!) bombs.app/Contents/PkgInfo: bombs$(EXEEXT) $(top_srcdir)/src/mac/carbon/Info.plist.in $(top_srcdir)/src/mac/carbon/wxmac.icns mkdir -p bombs.app/Contents mkdir -p bombs.app/Contents/MacOS mkdir -p bombs.app/Contents/Resources sed -e "s/IDENTIFIER/`echo $(srcdir) | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`/" \ -e "s/EXECUTABLE/bombs/" \ -e "s/VERSION/$(WX_VERSION)/" \ $(top_srcdir)/src/mac/carbon/Info.plist.in >bombs.app/Contents/Info.plist echo -n "APPL????" >bombs.app/Contents/PkgInfo ln -f bombs$(EXEEXT) bombs.app/Contents/MacOS/bombs cp -f $(top_srcdir)/src/mac/carbon/wxmac.icns bombs.app/Contents/Resources/wxmac.icns #bundle: $(_BUNDLE_TGT_REF_DEP) ### Include dependency info, if present: -include ./obj/*.d ### No idea what this does #.PHONY: all install uninstall clean distclean bundle