Improve making-a-release a little
[geany-mirror.git] / src / makefile.win32
blob147c4e2528041b7a4e31a60aabc9edc77031c60f
1 # Note: PACKAGE_DATA_DIR and PACKAGE_LOCALE_DIR are no longer used on Windows.
3 DEFINES = -DHAVE_CONFIG_H \
4         -DGEANY_PRIVATE \
5         -DGEANY_DATADIR=\"data\" \
6         -DGEANY_LOCALEDIR=\"\" \
7         -DGEANY_LIBDIR=\"\" \
8         -DGEANY_PREFIX=\"\" \
9         -DGTK \
10         -DGEANY_EXPORT_SYMBOL="__declspec(dllexport)" \
11         -DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL
13 .SUFFIXES: .c .o .h .a
14 WINDRES = windres.exe
15 CC = gcc
16 CXX = g++
17 RES = ../geany_private.res
18 TARGET = ../geany.exe
19 PREFIX = C:/libs
20 RM = del
21 -include ../localwin32.mk
23 ifdef MSYS
24 RM = rm -f
25 endif
27 GTK_INCLUDES= \
28         -I$(PREFIX)/include/gtk-2.0 \
29         -I$(PREFIX)/lib/gtk-2.0/include \
30         -I$(PREFIX)/include/atk-1.0 \
31         -I$(PREFIX)/include/cairo \
32         -I$(PREFIX)/include/gdk-pixbuf-2.0 \
33         -I$(PREFIX)/include/pango-1.0 \
34         -I$(PREFIX)/include/glib-2.0 \
35         -I$(PREFIX)/lib/glib-2.0/include \
36         -I$(PREFIX)/include \
37         -I$(PREFIX)/include/gettext
39 INCLUDEDIRS=  -I.. \
40               -I../scintilla/include \
41               -I../tagmanager/mio \
42               -I../tagmanager/src \
43               $(GTK_INCLUDES)
45 ALL_GTK_LIBS= \
46         -L"$(PREFIX)/lib" \
47         -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \
48         -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lgthread-2.0 -lintl \
49         -lcairo -lpangocairo-1.0 -lgio-2.0
50         # these things are for GTK >= 2.8
51         # (should be same as with MSYS: pkg-config --libs gtk+-2.0 gthread-2.0)
52         #"$(PREFIX)/lib/libcairo.dll.a" \
53         #"$(PREFIX)/lib/asprintf.lib" \
54         #"$(PREFIX)/lib/charset.lib" \
56 WIN_LIBS=-mwindows -lole32 -luuid -lwsock32
58 CBASEFLAGS=-Wall -pipe -mms-bitfields $(DEFINES) $(INCLUDEDIRS)
59 ifdef DEBUG
60 CFLAGS=-O0 -g $(CBASEFLAGS)
61 DEFINES += -DGEANY_DEBUG
62 else
63 CFLAGS=-O2 $(CBASEFLAGS)
64 endif
66 OBJS =  about.o build.o callbacks.o dialogs.o document.o editor.o encodings.o filetypes.o \
67                 geanyentryaction.o geanymenubuttonaction.o geanyobject.o geanywraplabel.o highlighting.o \
68                 keybindings.o keyfile.o log.o main.o msgwindow.o navqueue.o notebook.o \
69                 plugins.o pluginutils.o prefs.o printing.o project.o sciwrappers.o search.o \
70                 socket.o spawn.o stash.o symbols.o templates.o toolbar.o tools.o sidebar.o \
71                 ui_utils.o utils.o win32.o
73 .c.o:
74         $(CC) $(CFLAGS) -c $<
76 all: $(TARGET)
78 $(RES): ../geany_private.rc ../icons/geany.ico
79         $(WINDRES) -i $< --input-format=rc -o $@ -O coff
81 # this calls parent clean-local target because del ../file won't work
82 clean:
83         -$(RM) deps.mak *.o
84         $(MAKE) -C .. -f makefile.win32 clean-local
86 STLIBS = ../scintilla/scintilla.a ../tagmanager/ctags/ctags.a \
87         ../tagmanager/mio/mio.a ../tagmanager/src/tagmanager.a
89 $(TARGET): $(OBJS) $(RES) $(STLIBS)
90         $(CXX) $(OBJS) $(RES) -o $(TARGET) $(STLIBS) $(ALL_GTK_LIBS) $(WIN_LIBS)
92 deps.mak:
93         $(CC) -MM  $(CFLAGS) *.c >deps.mak
95 # Generate header dependencies with "make deps.mak"
96 include deps.mak
98 ..\localwin32.mk:
99         echo # Set local variables here >$@