#################################################################
## This Makefile Exported by MinGW Developer Studio
## Copyright (c) 2002-2004 by Parinya Thipchart
#################################################################

ifneq (,$(findstring Release, $(CFG)))
  override CFG = Release
else
  override CFG = Debug
endif

PROJECT = DownloadDictionaries
CC = g++

ifeq ($(CFG),Debug)
  OBJ_DIR = Debug
  OUTPUT_DIR = ../bin
  TARGET = DownloadDictionariesD
  C_INCLUDE_DIRS = -I"../include" 
  C_PREPROC = 
  CFLAGS = -pipe `wx-config --cxxflags` -Wall -g2 -O0 -fno-rtti -fno-exceptions 
  LIB_DIRS = 
  LIBS = 
  LDFLAGS = -pipe ./lib_bzipstreamd.a ../lib/libwx_spellcheckd.a `wx-config --libs`
endif

ifeq ($(CFG),Release)
  OBJ_DIR = Release
  OUTPUT_DIR = ../bin
  TARGET = DownloadDictionaries
  C_INCLUDE_DIRS = -I"../include" 
  C_PREPROC = 
  CFLAGS = -pipe `wx-config --cxxflags` -Wall -g0 -O2 -fno-rtti -fno-exceptions 
  LIB_DIRS = 
  LIBS = 
  LDFLAGS = -pipe -s ./lib_bzipstream.a ../lib/libwx_spellcheck.a `wx-config --libs`
endif

SRC_OBJS = \
  $(OBJ_DIR)/DictionaryWizard.o	\
  $(OBJ_DIR)/wizard.o	\
  $(OBJ_DIR)/AspellDictionaryDownloader.o

define build_target
@echo Linking...
@$(CC) -o "$(OUTPUT_DIR)/$(TARGET)" $(SRC_OBJS) $(LIB_DIRS) $(LIBS) $(LDFLAGS)
endef

define compile_source
@echo Compiling $<
@$(CC) $(CFLAGS) $(C_PREPROC) $(C_INCLUDE_DIRS) -c "$<" -o "$@"
endef

.PHONY: print_header directories

$(TARGET): print_header directories $(SRC_OBJS)
	$(build_target)

.PHONY: clean cleanall

cleanall:
	@echo Deleting intermediate files for 'DownloadDictionaries - $(CFG)'
	-@rm -rf "$(OBJ_DIR)"
	-@rm -rf "$(OUTPUT_DIR)/$(TARGET)"
	-@rmdir "$(OUTPUT_DIR)"

clean:
	@echo Deleting intermediate files for 'DownloadDictionaries - $(CFG)'
	-@rm -rf $(OBJ_DIR)

print_header:
	@echo ----------Configuration: DownloadDictionaries - $(CFG)----------

directories:
	-@if [ ! -d "$(OUTPUT_DIR)" ]; then mkdir "$(OUTPUT_DIR)"; fi
	-@if [ ! -d "$(OBJ_DIR)" ]; then mkdir "$(OBJ_DIR)"; fi

$(OBJ_DIR)/DictionaryWizard.o: DictionaryWizard.cpp	\
DictionaryWizard.h	\
EngineDictionaryDownloader.h	\
wiztest.xpm
	$(compile_source)

$(OBJ_DIR)/wizard.o: wizard.cpp	\
AspellDictionaryDownloader.h	\
EngineDictionaryDownloader.h	\
DictionaryWizard.h
	$(compile_source)

$(OBJ_DIR)/AspellDictionaryDownloader.o: AspellDictionaryDownloader.cpp	\
AspellDictionaryDownloader.h	\
EngineDictionaryDownloader.h	\
bzipstream/bzipstream.h
	$(compile_source)



