Fri, 11 Oct 2002 03:14:01 +0000
[gaim-migrate @ 3753]
Yeah this will probably break a lot of shit knowing my luck. But hey, I really don't care what people thnk.
| 3630 | 1 | # |
| 2 | # Makefile.mingw | |
| 3 | # | |
| 4 | # Description: Makefile for win32 (mingw) version of libirc | |
| 5 | # | |
| 6 | ||
| 7 | # | |
| 8 | # PATHS | |
| 9 | # | |
| 10 | ||
| 11 | INCLUDE_DIR := . | |
| 12 | GTK_TOP := ../../../../win32-dev/gtk_2_0 | |
| 13 | GAIM_TOP := ../../.. | |
| 14 | IRC_ROOT := . | |
| 15 | GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir | |
| 16 | ||
| 17 | ## | |
| 18 | ## VARIABLE DEFINITIONS | |
| 19 | ## | |
| 20 | ||
| 21 | TARGET = libirc | |
| 22 | ||
| 23 | VERSION := $(shell cat $(GAIM_TOP)/VERSION) | |
| 24 | ||
| 25 | # Compiler Options | |
| 26 | ||
| 27 | CC = gcc | |
| 28 | ||
| 29 | CFLAGS = -O2 -Werror -Wall -mno-cygwin -fnative-struct | |
| 30 | ||
| 31 | DEFINES = -DAIM_BUILDDATE=\"`date +%Y%m%d`\" \ | |
| 32 | -DAIM_BUILDTIME=\"`date +%H%M%S`\" \ | |
| 33 | -DVERSION=\"$(VERSION)\" \ | |
| 34 | -DHAVE_CONFIG_H | |
| 35 | ||
| 36 | # Static or Plugin... | |
| 37 | ifeq ($(TYPE),STATIC) | |
| 38 | DEFINES += -DSTATIC | |
| 39 | DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR) | |
| 40 | else | |
| 41 | ifeq ($(TYPE),PLUGIN) | |
| 42 | DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR)/plugins | |
| 43 | endif | |
| 44 | endif | |
| 45 | ||
| 46 | ||
| 47 | ## | |
| 48 | ## INCLUDE MAKEFILES | |
| 49 | ## | |
| 50 | ||
| 51 | ||
| 52 | ## | |
| 53 | ## INCLUDE PATHS | |
| 54 | ## | |
| 55 | ||
| 56 | INCLUDE_PATHS += -I$(IRC_ROOT) \ | |
| 57 | -I$(GTK_TOP)/include \ | |
| 58 | -I$(GTK_TOP)/include/gtk-2.0 \ | |
| 59 | -I$(GTK_TOP)/include/glib-2.0 \ | |
| 60 | -I$(GTK_TOP)/include/pango-1.0 \ | |
| 61 | -I$(GTK_TOP)/include/atk-1.0 \ | |
| 62 | -I$(GTK_TOP)/lib/glib-2.0/include \ | |
| 63 | -I$(GTK_TOP)/lib/gtk-2.0/include \ | |
| 64 | -I$(GAIM_TOP)/src \ | |
| 65 | -I$(GAIM_TOP)/src/win32 \ | |
| 66 | -I$(GAIM_TOP) | |
| 67 | ||
| 68 | ||
| 69 | LIB_PATHS = -L$(GTK_TOP)/lib \ | |
| 70 | -L$(GAIM_TOP)/src | |
| 71 | ||
| 72 | ||
| 73 | ## | |
| 74 | ## SOURCES, OBJECTS | |
| 75 | ## | |
| 76 | ||
| 77 | C_SRC = irc.c | |
| 78 | ||
| 79 | ||
| 80 | OBJECTS = $(C_SRC:%.c=%.o) | |
| 81 | ||
| 82 | ||
| 83 | ## | |
| 84 | ## LIBRARIES | |
| 85 | ## | |
| 86 | ||
| 87 | LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lws2_32 -lintl -lgaim | |
| 88 | ||
| 89 | # -liberty | |
| 90 | ||
| 91 | ||
| 92 | ## | |
| 93 | ## RULES | |
| 94 | ## | |
| 95 | ||
| 96 | # How to make a C file | |
| 97 | ||
| 98 | %.o: %.c | |
| 99 | $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< | |
| 100 | ||
| 101 | ## | |
| 102 | ## TARGET DEFINITIONS | |
| 103 | ## | |
| 104 | ||
| 105 | .PHONY: all clean | |
| 106 | ||
| 107 | all: $(TARGET).dll | |
| 108 | ||
| 109 | install: | |
| 110 | cp $(IRC_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR) | |
| 111 | ||
| 112 | ||
| 113 | ## | |
| 114 | ## BUILD Dependencies | |
| 115 | ## | |
| 116 | ||
| 117 | $(GAIM_TOP)/src/gaim.lib: | |
| 118 | $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib | |
| 119 | ||
| 120 | ## | |
| 121 | ## BUILD DLL | |
| 122 | ## | |
| 123 | ||
| 124 | $(TARGET).def: $(OBJECTS) | |
| 125 | dlltool --dllname $(TARGET).dll -z $(TARGET).def \ | |
| 126 | $(OBJECTS) | |
| 127 | ||
| 128 | $(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib | |
| 129 | gcc -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS) | |
| 130 | rm -rf junk.tmp | |
| 131 | ||
| 132 | $(TARGET).exp: $(TARGET).def $(TARGET).base | |
| 133 | dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \ | |
| 134 | --output-exp $(TARGET).exp --def $(TARGET).def | |
| 135 | rm -rf $(TARGET).base | |
| 136 | ||
| 137 | $(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib | |
| 138 | dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib | |
| 139 | gcc -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS) | |
| 140 | rm -rf $(TARGET).exp | |
| 141 | ||
| 142 | ||
| 143 | ## | |
| 144 | ## CLEAN RULES | |
| 145 | ## | |
| 146 | ||
| 147 | clean: | |
| 148 | rm -rf *.o | |
| 149 | rm -rf $(TARGET).dll | |
| 150 | rm -rf $(TARGET).lib | |
| 151 | rm -rf $(TARGET).def |