view pidgin/Makefile.mingw @ 15910:ce931aecfe47

merge of '1173b4c1787e5dff1b7103c46ca71ed23f199be7' and '98d5e808eab20e351835260903d6a92ac07b8d78'
author Evan Schoenberg <evan.s@dreskin.net>
date Sun, 25 Mar 2007 01:45:25 +0000
parents e04c98c1bce9
children ded8da3de5f8
line wrap: on
line source

#
# Makefile.mingw
#
# Description: Makefile for win32 (mingw) version of Gaim
#

GAIM_TOP := ..
include $(GAIM_TOP)/libpurple/win32/global.mak

NEEDED_DLLS = $(GTKSPELL_TOP)/gtkspell/libgtkspell.dll

##
## VARIABLE DEFINITIONS
##
EXE_TARGET := pidgin
GTKGAIM_TARGET := pidgin
EXE_NAME := $(EXE_TARGET).exe

WINAPP := -mwindows

LDFLAGS := $(WINAPP)

##
## INCLUDE PATHS
##
LIBGAIM_INCLUDE_PATHS =	\
			-I$(GAIM_LIB_TOP) \
			-I$(GAIM_LIB_TOP)/win32 \
			-I$(GAIM_TOP) \
			-I$(GTK_TOP)/include \
			-I$(GTK_TOP)/include/glib-2.0 \
			-I$(GTK_TOP)/lib/glib-2.0/include

INCLUDE_PATHS =	\
			$(LIBGAIM_INCLUDE_PATHS) \
			-I$(GAIM_GTK_IDLETRACK_TOP) \
			-I$(GAIM_GTK_TOP) \
			-I$(GAIM_GTK_TOP)/win32 \
			-I$(GTK_TOP)/include/gtk-2.0 \
			-I$(GTK_TOP)/include/pango-1.0 \
			-I$(GTK_TOP)/include/atk-1.0 \
			-I$(GTK_TOP)/lib/gtk-2.0/include \
			-I$(GTKSPELL_TOP) \
			-I$(ASPELL_TOP)/include

LIB_PATHS =		-L$(GTK_TOP)/lib \
			-L$(GAIM_LIB_TOP) \
			-L$(GAIM_GTK_TOP) \
			-L$(GAIM_GTK_IDLETRACK_TOP) \
			-L$(ASPELL_TOP)/lib

##
##  SOURCES, OBJECTS
##
GTKGAIM_C_SRC =	\
			gtkaccount.c \
			gtkblist.c \
			gtkconn.c \
			gtkconv.c \
			gtkcellrendererexpander.c \
			gtkcellrendererprogress.c \
			gtkdebug.c \
			gtkdialogs.c \
			gtkdnd-hints.c \
			gtkdocklet.c \
			gtkeventloop.c \
			gtkexpander.c \
			gtkft.c \
			gtkidle.c \
			gtkimhtml.c \
			gtkimhtmltoolbar.c \
			gtklog.c \
			gtkmain.c \
			gtkmenutray.c \
			gtknotify.c \
			gtkplugin.c \
			gtkpluginpref.c \
			gtkpounce.c \
			gtkprefs.c \
			gtkprivacy.c \
			gtkrequest.c \
			gtkroomlist.c \
			gtksavedstatuses.c \
			gtkscrollbook.c \
			gtksound.c \
			gtksourceiter.c \
			gtkstatusbox.c \
			gtkthemes.c \
			gtkutils.c \
			gtkwhiteboard.c \
			pidginstock.c \
			win32/MinimizeToTray.c \
			win32/gtkdocklet-win32.c \
			win32/gtkwin32dep.c \
			win32/untar.c \
			win32/wspell.c

GTKGAIM_RC_SRC = win32/pidgin_dll_rc.rc
GTKGAIM_OBJECTS = $(GTKGAIM_C_SRC:%.c=%.o) $(GTKGAIM_RC_SRC:%.rc=%.o)

EXE_RC_SRC = win32/pidgin_exe_rc.rc
EXE_C_SRC = win32/winpidgin.c
EXE_OBJECTS = $(EXE_C_SRC:%.c=%.o) $(EXE_RC_SRC:%.rc=%.o)

##
## LIBRARIES
##
LIBGAIM_LIBS =	\
		-lpurple \
		-lglib-2.0 \
		-lgthread-2.0 \
		-lgobject-2.0 \
		-lgmodule-2.0 \
		-lintl \
		-lws2_32 \
		-lwinmm \
		-lz

GTKGAIM_LIBS =	\
		$(LIBGAIM_LIBS) \
		-lidletrack \
		-lgtk-win32-2.0 \
		-latk-1.0 \
		-lpango-1.0 \
		-lgdk-win32-2.0 \
		-lgdk_pixbuf-2.0 \
		-lgdi32

include $(GAIM_COMMON_RULES)

##
## TARGET DEFINITIONS
##
.PHONY: all install install_shallow clean clean_exe

all: $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll
	$(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE)

win32/pidgin_exe_rc.rc: win32/pidgin_exe_rc.rc.in $(GAIM_TOP)/VERSION
	sed -e 's/@PIDGIN_VERSION@/$(GAIM_VERSION)/g' \
	    -e 's/@ORIGINAL_FILENAME@/$(EXE_NAME)/' \
	    $@.in > $@

install_shallow: $(GAIM_INSTALL_DIR) $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll
	cp $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll $(GAIM_INSTALL_DIR)
	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)

install: install_shallow all
	$(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
	$(MAKE) -C $(GAIM_GTK_PIXMAPS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
	$(MAKE) -C $(GAIM_GTK_SOUNDS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
	$(MAKE) -C $(GAIM_GTK_IDLETRACK_TOP) -f $(GAIM_WIN32_MAKEFILE) install

win32/pidgin_dll_rc.rc: win32/pidgin_dll_rc.rc.in $(GAIM_TOP)/VERSION
	sed -e 's/@PIDGIN_VERSION@/$(GAIM_VERSION)/g' \
	    $@.in > $@

$(EXE_OBJECTS) $(GTKGAIM_OBJECTS): $(GAIM_CONFIG_H)

$(GTKGAIM_TARGET).dll $(GTKGAIM_TARGET).dll.a: $(GAIM_LIBGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(GTKGAIM_OBJECTS)
	$(CC) -shared $(GTKGAIM_OBJECTS) $(LIB_PATHS) $(GTKGAIM_LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(GTKGAIM_TARGET).dll.a -o $(GTKGAIM_TARGET).dll

$(EXE_TARGET).exe: $(GAIM_CONFIG_H) $(GAIM_GTKGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(EXE_OBJECTS)
	$(CC) $(LDFLAGS) $(EXE_OBJECTS) -o $(EXE_TARGET).exe

$(EXE_TARGET)-portable.exe: DEFINES += -DPORTABLE
$(EXE_TARGET)-portable.exe: EXE_NAME := $(EXE_TARGET)-portable.exe
$(EXE_TARGET)-portable.exe: clean_exe $(GAIM_CONFIG_H) $(GAIM_GTKGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(EXE_OBJECTS)
	$(CC) $(LDFLAGS) $(EXE_OBJECTS) -o $(EXE_TARGET)-portable.exe
	$(MAKE) -f $(GAIM_WIN32_MAKEFILE) clean_exe

##
## CLEAN RULES
##
clean:
	$(MAKE) -C $(GAIM_GTK_IDLETRACK_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
	$(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
	rm -f $(GTKGAIM_OBJECTS) $(GTKGAIM_RC_SRC) $(EXE_OBJECTS) $(EXE_RC_SRC)
	rm -f $(GTKGAIM_TARGET).dll $(GTKGAIM_TARGET).dll.a
	rm -f $(EXE_TARGET).exe $(EXE_TARGET)-portable.exe

clean_exe:
	rm -f $(EXE_OBJECTS) $(EXE_RC_SRC)

include $(GAIM_COMMON_TARGETS)