view src/Makefile.mingw @ 12360:3153661f4d5c

[gaim-migrate @ 14664] Faceprint is concerned about 2 things: 1)some of the random colors are very close together. as best we can tell, there are two ways to fix this 1a) for each proposed color, iterate the entire list of selected colors, looking to ensure that it is not too close to any of them. this is an O(n^2) operation, with n >= 220 (the current number of colors we look for) 1b) iterate the entire set of possible colors, skipping ahead by some guess (rather than iterating by 1). this is an O(n^3) operation, where n is 65535/(whatever we skip ahead by). This is not only a more expensive operation, but because of the nature of the color list, it is not _necessarily_ going to yield more predictable results, skipping ahead 5 (or any other number) does not necessarily guarantee that you've skipped 5 very similar colors. 2) as you can see, either solution to #1 is potentially a resource hog. #1a is a random delay, #1b is inherently expensive. How often #1a will exceed the bound #1b, if ever, is unknown. rather than doing either of these, we settled on a middle course: a .h file has been created containing a set of colors. currently the set we were previously hard coded to. Gaim will search that list for usable colors and start randomly looking only if that list does not contain sufficient usable colors. ideally this list would be generated to have colors that are known to be a "safe" distance appart, that is colors that you can tell appart. and Ideally it would have a (small) multiple of the number of colors we are searching for. This should ensure that IF we go to randomly searching, we need do so only for a few colors. Right now I have no good way to generate a "safe" list of colors though. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 05 Dec 2005 21:46:47 +0000
parents 3ef381cdc47e
children 33bef17125c2
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 :=		.
ASPELL_TOP :=		../../win32-dev/aspell-dev-0-50-3-3
GTKSPELL_TOP :=		../../win32-dev/gtkspell-2.0.6
IDLETRACK_TOP :=	$(GAIM_TOP)/src/win32/IdleTracker
GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
NSS_DIR :=		../../win32-dev/nss-3.9
NSPR_DIR :=		../../win32-dev/nspr-4.4.1

##
## VARIABLE DEFINITIONS
##

TARGET = gaim

# Compiler and Linker Options

CFLAGS =

DEFINES =

ifeq ($(MAKECMDGOALS), $(TARGET)-portable.exe)
DEFINES := $(DEFINES) -DPORTABLE
endif

LDFLAGS = -mwindows

#-mconsole
#-mwindows

WINDRES := windres

##
## INCLUDE  MAKEFILES
##

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

##
## INCLUDE PATHS
##

INCLUDE_PATHS =		-I$(INCLUDE_DIR) \
			-I$(INCLUDE_DIR)/win32 \
			-I$(IDLETRACK_TOP) \
			-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$(ASPELL_TOP)/include \
			-I$(GTKSPELL_TOP) \
			-I$(NSS_DIR)/include \
			-I$(NSPR_DIR)/include


LIB_PATHS =		-L$(GTK_TOP)/lib \
			-L$(GAIM_SRC) \
			-L$(IDLETRACK_TOP) \
			-L$(ASPELL_TOP)/lib \
			-L$(NSS_DIR)/lib \
			-L$(NSPR_DIR)/lib

##
##  SOURCES, OBJECTS
##

DLL_C_SRC =	\
			account.c \
			accountopt.c \
			blist.c \
			buddyicon.c \
			cipher.c \
			cmds.c \
			connection.c \
			conversation.c \
			core.c \
			debug.c \
			dnssrv.c \
			eventloop.c \
			ft.c \
			gtkaccount.c \
			gtkblist.c \
			gtkconn.c \
			gtkconv.c \
			gtkcellrendererprogress.c \
			gtkdebug.c \
			gtkdialogs.c \
			gtkdnd-hints.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 \
			gtksound.c \
			gtksourceiter.c \
			gtkstatusbox.c \
			gtkstock.c \
			gtkthemes.c \
			gtkutils.c \
			gtkwhiteboard.c \
			idle.c \
			imgstore.c \
			log.c \
			mime.c \
			network.c \
			notify.c \
			ntlm.c \
			plugin.c \
			pluginpref.c \
			pounce.c \
			prefs.c \
			privacy.c \
			proxy.c \
			prpl.c \
			request.c \
			roomlist.c \
			savedstatuses.c \
			server.c \
			signals.c \
			sound.c \
			sslconn.c \
			status.c \
			stringref.c \
			stun.c \
			upnp.c \
			util.c \
			value.c \
			xmlnode.c \
			whiteboard.c \
			win32/win32dep.c \
			win32/libc_interface.c \
			win32/wspell.c \
			win32/untar.c

RC_SRC =		win32/gaimrc.rc

EXE_C_SRC = 		win_gaim.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 \
			-latk-1.0 \
			-lpango-1.0 \
			-lglib-2.0 \
			-lgthread-2.0 \
			-lgdk-win32-2.0 \
			-lgobject-2.0 \
			-lintl \
			-lgmodule-2.0 \
			-lgdk_pixbuf-2.0 \
			-lws2_32 \
			-liberty \
			-lwinmm \
			-lz \
			-lidletrack \
			-lnss3 \
			-lnspr4 \
			-lssl3
			

EXE_LIBS =

##
## RULES
##

# 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: all
	cp $(GAIM_SRC)/gaim.exe $(GAIM_SRC)/gaim.dll $(GAIM_INSTALL_DIR)

$(IDLETRACK_TOP)/idletrack.dll:
	$(MAKE) -C $(IDLETRACK_TOP) -f Makefile.mingw

#
# BUILD DLL
#

$(TARGET).lib $(TARGET).dll: $(DLL_OBJECTS) $(IDLETRACK_TOP)/idletrack.dll
	$(CC) -shared $(DLL_OBJECTS) $(LIB_PATHS) $(DLL_LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll

#
# BUILD EXE
#

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

$(TARGET)-portable.exe: clean_exe $(EXE_OBJECTS)
	$(CC) $(LDFLAGS) $(EXE_OBJECTS) $(LIB_PATHS) $(EXE_LIBS) -o $(TARGET)-portable.exe
	rm win_gaim.o

##
## CLEAN RULES
##

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

clean_exe:
	rm -rf win_gaim.o