view src/Makefile.mingw @ 3802:9bcb42faccc0

[gaim-migrate @ 3945] Rewrote show_im_dialog and show_info_dialog. Ported to gtkspell2. Gtkspell2 is a library available from gtkspell.sf.net. It requires the pspell library. If you want the "highlight misspelled words" feature to work, you must have this library installed. If installed, configure will detect it and link against it. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 26 Oct 2002 06:41:13 +0000
parents 764d6f1848b2
children 3cd422d1d958
line wrap: on
line source

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

#
# PATHS
#

INCLUDE_DIR :=		.
GTK_TOP :=		../../win32-dev/gtk_2_0
GAIM_TOP :=		..
GAIM_SRC :=		.
PERL_LIB_DIR :=		../../win32-dev/perl56
PERL_INCLUDE :=         $(PERL_LIB_DIR)/CORE
GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir

##
## VARIABLE DEFINITIONS
##

TARGET = gaim

# Compiler and Linker Options

CFLAGS =

DEFINES =

LDFLAGS = -mwindows

#-mconsole
#-mwindows

##
## INCLUDE  MAKEFILES
##

include $(GAIM_TOP)/src/win32/global.mak

##
## INCLUDE PATHS
##

INCLUDE_PATHS =		-I$(INCLUDE_DIR) \
			-I$(INCLUDE_DIR)/win32 \
			-I$(GAIM_TOP) \
			-I$(GTK_TOP)/include \
			-I$(GTK_TOP)/include/gtk-2.0 \
			-I$(GTK_TOP)/include/glib-2.0 \
			-I$(GTK_TOP)/include/pango-1.0 \
			-I$(GTK_TOP)/include/atk-1.0 \
			-I$(GTK_TOP)/lib/glib-2.0/include \
			-I$(GTK_TOP)/lib/gtk-2.0/include \
			-I$(PERL_INCLUDE)


LIB_PATHS =		-L$(GTK_TOP)/lib \
			-L$(GAIM_SRC) \
			-L$(PERL_LIB_DIR)


##
##  SOURCES, OBJECTS
##

SOUND_H_FILES =		$(GAIM_TOP)/sounds/BuddyArrive.h \
			$(GAIM_TOP)/sounds/BuddyLeave.h \
			$(GAIM_TOP)/sounds/Receive.h \
			$(GAIM_TOP)/sounds/RedAlert.h \
			$(GAIM_TOP)/sounds/Send.h

HEADER_DEPS =		$(SOUND_H_FILES)

DLL_C_SRC =		aim.c \
			about.c \
			away.c \
			browser.c \
			buddy.c \
			buddy_chat.c \
			conversation.c \
			core.c \
			dialogs.c \
			ft.c \
			gaimrc.c \
			gtkimhtml.c \
			gtkspell.c \
			html.c \
			idle.c \
			list.c \
			md5.c \
			module.c \
			multi.c \
			perl.c \
			prefs.c \
			proxy.c \
			prpl.c \
			server.c \
			sound.c \
			util.c \
			win32/win32dep.c \
			win32/MinimizeToTray.c \
			win32/libc_interface.c

RC_SRC =		win32/gaimrc.rc

EXE_C_SRC = 		win_aim.c

DLL_OBJECTS = $(DLL_C_SRC:%.c=%.o) 

EXE_OBJECTS = $(EXE_C_SRC:%.c=%.o) $(RC_SRC:%.rc=%.o) 

##
## LIBRARIES
##

DLL_LIBS = 		-lgtk-win32-2.0 \
			-lpango-1.0 \
			-lglib-2.0 \
			-lgdk-win32-2.0 \
			-lgobject-2.0 \
			-lintl \
			-lgmodule-2.0 \
			-lgdk_pixbuf-2.0 \
			-lws2_32 \
			-liberty \
			-lwinmm \
			-lperl56


EXE_LIBS = -lgaim -lglib-2.0

##
## RULES
##

# Make Sound headers
$(GAIM_TOP)/sounds/%.h:
	$(MAKE) -C $(GAIM_TOP)/sounds -f Makefile.mingw $(@F)

# How to make a C file
%.o: %.c
	$(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@

# How to make an RC file
%.o: %.rc
	windres -i $< -o $@

##
## TARGET DEFINITIONS
##

.PHONY: all clean

all: $(TARGET).exe $(TARGET).dll

install:
	cp $(GAIM_SRC)/gaim.exe $(GAIM_SRC)/gaim.dll $(GAIM_INSTALL_DIR)


#
# BUILD DLL
#

$(TARGET).def: $(HEADER_DEPS) $(DLL_OBJECTS)
	dlltool -D $(TARGET).dll -z $(TARGET).def --export-all-symbols \
		--exclude-symbols WinMain@16 $^

$(TARGET).base: $(HEADER_DEPS) $(DLL_OBJECTS)
	$(CC) -mdll $(LDFLAGS) -o junk.tmp -Wl,--base-file,$@ $(DLL_OBJECTS) $(LIB_PATHS) $(DLL_LIBS)
	rm -rf junk.tmp

$(TARGET).exp: $(TARGET).base $(TARGET).def
	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
		--output-exp $(TARGET).exp --def $(TARGET).def

$(TARGET).dll: $(HEADER_DEPS) $(DLL_OBJECTS) $(TARGET).exp
	$(CC) -mdll $(LDFLAGS) -o $(TARGET).dll $(DLL_OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(DLL_LIBS)
	rm -rf $(TARGET).exp $(TARGET).def $(TARGET).base

$(TARGET).lib: $(TARGET).def
	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib	

#
# BUILD EXE
#

$(TARGET).exe: $(TARGET).lib $(EXE_OBJECTS)
	$(CC) $(LDFLAGS) $(EXE_OBJECTS) $(LIB_PATHS) $(EXE_LIBS) -o $(TARGET).exe

##
## CLEAN RULES
##

clean:
	$(MAKE) -C $(GAIM_TOP)/sounds -f Makefile.mingw clean
	rm -rf *.o ./win32/*.o
	rm -rf $(TARGET).dll
	rm -rf $(TARGET).lib
	rm -rf $(TARGET).exe