| 1 # |
|
| 2 # Makefile.mingw |
|
| 3 # |
|
| 4 # Description: Makefile for Gaim perl module. |
|
| 5 # |
|
| 6 |
|
| 7 TARGET = Gaim |
|
| 8 AUTOSPLIT = lib/auto/Gaim/autosplit.ix |
|
| 9 |
|
| 10 ## |
|
| 11 ## TOOLS |
|
| 12 ## |
|
| 13 |
|
| 14 CC := gcc |
|
| 15 PERL := /cygdrive/c/perl/bin/perl |
|
| 16 |
|
| 17 ## |
|
| 18 ## PATHS |
|
| 19 ## |
|
| 20 |
|
| 21 EXTUTILS := C:/perl/lib/ExtUtils |
|
| 22 GAIM_TOP := ../../.. |
|
| 23 GTK_TOP := ../../../../win32-dev/gtk_2_0 |
|
| 24 PERL_TOP := ../../../../win32-dev/perl58 |
|
| 25 PERL_PLUGIN_TOP := .. |
|
| 26 GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir |
|
| 27 PERLMOD_INSTALL_DIR := $(GAIM_INSTALL_DIR)/perlmod |
|
| 28 |
|
| 29 |
|
| 30 INCLUDE_PATHS = -I. \ |
|
| 31 -I$(GAIM_TOP) \ |
|
| 32 -I$(GAIM_TOP)/src \ |
|
| 33 -I$(GTK_TOP)/include \ |
|
| 34 -I$(GTK_TOP)/include/gtk-2.0 \ |
|
| 35 -I$(GTK_TOP)/include/glib-2.0 \ |
|
| 36 -I$(GTK_TOP)/include/pango-1.0 \ |
|
| 37 -I$(GTK_TOP)/include/atk-1.0 \ |
|
| 38 -I$(GTK_TOP)/lib/gtk-2.0/include \ |
|
| 39 -I$(GTK_TOP)/lib/glib-2.0/include \ |
|
| 40 -I$(PERL_TOP)/CORE |
|
| 41 |
|
| 42 LIB_PATHS = -L$(PERL_TOP) \ |
|
| 43 -L$(PERL_PLUGIN_TOP) \ |
|
| 44 -L$(GAIM_TOP)/src \ |
|
| 45 -L$(GTK_TOP)/lib |
|
| 46 |
|
| 47 |
|
| 48 ## |
|
| 49 ## SOURCES, OBJECTS |
|
| 50 ## |
|
| 51 |
|
| 52 XS_FILES = Account.xs \ |
|
| 53 AccountOpts.xs \ |
|
| 54 BuddyIcon.xs \ |
|
| 55 BuddyList.xs \ |
|
| 56 Cipher.xs \ |
|
| 57 Cmds.xs \ |
|
| 58 Connection.xs \ |
|
| 59 Conversation.xs \ |
|
| 60 FT.xs \ |
|
| 61 Gaim.xs \ |
|
| 62 ImgStore.xs \ |
|
| 63 Log.xs \ |
|
| 64 Network.xs \ |
|
| 65 Notify.xs \ |
|
| 66 Plugin.xs \ |
|
| 67 PluginPref.xs \ |
|
| 68 Pounce.xs \ |
|
| 69 Prefs.xs \ |
|
| 70 Privacy.xs \ |
|
| 71 Proxy.xs \ |
|
| 72 Prpl.xs \ |
|
| 73 Request.xs \ |
|
| 74 Roomlist.xs \ |
|
| 75 SSLConn.xs \ |
|
| 76 SavedStatuses.xs \ |
|
| 77 Server.xs \ |
|
| 78 Sound.xs \ |
|
| 79 Status.xs \ |
|
| 80 Stringref.xs \ |
|
| 81 Util.xs \ |
|
| 82 XMLNode.xs \ |
|
| 83 |
|
| 84 FALLBACKS = const-c.inc const-xs.inc |
|
| 85 |
|
| 86 C_FILES = $(XS_FILES:%.xs=%.c) |
|
| 87 |
|
| 88 OBJECTS = $(C_FILES:%.c=%.o) |
|
| 89 |
|
| 90 ## |
|
| 91 ## LIBRARIES |
|
| 92 ## |
|
| 93 |
|
| 94 LIBS = -lperl58 \ |
|
| 95 -lperl \ |
|
| 96 -lgaim \ |
|
| 97 -lglib-2.0 |
|
| 98 |
|
| 99 ## |
|
| 100 ## RULES |
|
| 101 ## |
|
| 102 |
|
| 103 # How to make a C file |
|
| 104 %.o: %.c |
|
| 105 $(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@ |
|
| 106 |
|
| 107 # How to make a XS file |
|
| 108 %.c: %.xs |
|
| 109 $(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap -typemap typemap $< > $@ |
|
| 110 |
|
| 111 %.inc: |
|
| 112 cp fallback/$@ ./ |
|
| 113 |
|
| 114 ## |
|
| 115 ## TARGETS |
|
| 116 ## |
|
| 117 |
|
| 118 .PHONY: all clean |
|
| 119 |
|
| 120 all: $(TARGET).dll $(AUTOSPLIT) |
|
| 121 |
|
| 122 install: |
|
| 123 rm -rf $(PERLMOD_INSTALL_DIR) |
|
| 124 cp -R lib $(PERLMOD_INSTALL_DIR) |
|
| 125 cp $(TARGET).dll $(PERLMOD_INSTALL_DIR) |
|
| 126 |
|
| 127 $(AUTOSPLIT): Gaim.pm |
|
| 128 mkdir -p ./lib/auto |
|
| 129 cp Gaim.pm ./lib |
|
| 130 $(PERL) -MAutoSplit -e 'autosplit("lib/Gaim.pm")' |
|
| 131 |
|
| 132 $(TARGET).dll: $(FALLBACKS) $(OBJECTS) |
|
| 133 $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) -o $(TARGET).dll |
|
| 134 |
|
| 135 ## |
|
| 136 ## CLEAN |
|
| 137 ## |
|
| 138 |
|
| 139 clean: |
|
| 140 rm -rf *.o $(TARGET).dll $(FALLBACKS) lib |
|