Fix building with makefile.win32 from Windows command prompt, not MSYS
[geany-mirror.git] / src / makefile.win32
blobb164cf8c241ccd4c71516eab142120e4774671d7
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
11 .SUFFIXES: .c .o .h .a
12 WINDRES = windres.exe
13 CC = gcc
14 CXX = g++
15 RES  = ../geany_private.res
16 TARGET = ../geany.exe
17 EXECDIR = c:\distrib
18 PREFIX = C:\libs
19 RM = del
20 -include ../localwin32.mk
22 GTK_INCLUDES= \
23         -I$(PREFIX)/include/gtk-2.0 \
24         -I$(PREFIX)/lib/gtk-2.0/include \
25         -I$(PREFIX)/include/atk-1.0 \
26         -I$(PREFIX)/include/cairo \
27         -I$(PREFIX)/include/gdk-pixbuf-2.0 \
28         -I$(PREFIX)/include/pango-1.0 \
29         -I$(PREFIX)/include/glib-2.0 \
30         -I$(PREFIX)/lib/glib-2.0/include \
31         -I$(PREFIX)/include \
32         -I$(PREFIX)/include/gettext
34 INCLUDEDIRS=  -I.. \
35               -I../scintilla/include \
36               -I../tagmanager/mio \
37               -I../tagmanager/include \
38               $(GTK_INCLUDES)
40 ALL_GTK_LIBS= \
41         -L"$(PREFIX)/lib" \
42         -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \
43         -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lgthread-2.0 -lintl \
44         -lcairo -lpangocairo-1.0 -lgio-2.0
45         # these things are for GTK >= 2.8
46         # (should be same as with MSYS: pkg-config --libs gtk+-2.0 gthread-2.0)
47         #"$(PREFIX)/lib/libcairo.dll.a" \
48         #"$(PREFIX)/lib/asprintf.lib" \
49         #"$(PREFIX)/lib/charset.lib" \
51 WIN_LIBS=-mwindows -lole32 -luuid -liberty -lwsock32
53 CBASEFLAGS=-Wall -pipe -mms-bitfields $(DEFINES) $(INCLUDEDIRS)
54 ifdef DEBUG
55 CFLAGS=-O0 -g $(CBASEFLAGS)
56 DEFINES += -DGEANY_DEBUG
57 else
58 CFLAGS=-O2 $(CBASEFLAGS)
59 endif
61 OBJS =  about.o build.o callbacks.o dialogs.o document.o editor.o encodings.o filetypes.o \
62                 geanyentryaction.o geanymenubuttonaction.o geanyobject.o geanywraplabel.o highlighting.o \
63                 keybindings.o keyfile.o log.o main.o msgwindow.o navqueue.o notebook.o \
64                 plugins.o pluginutils.o prefs.o printing.o project.o sciwrappers.o search.o \
65                 socket.o stash.o symbols.o templates.o toolbar.o tools.o sidebar.o \
66                 ui_utils.o utils.o win32.o
68 .c.o:
69         $(CC) $(CFLAGS) -c $<
71 # all: binclean $(TARGET) #exec
72 all: $(TARGET)
74 $(RES): ../geany_private.rc ../icons/geany.ico
75         $(WINDRES) -i $< --input-format=rc -o $@ -O coff
77 # this calls parent clean-local target because del ../file won't work
78 clean:
79         -$(RM) deps.mak *.o
80         $(MAKE) -C .. -f makefile.win32 clean-local
82 exec:
83         $(EXECDIR)\geany.exe
85 binclean:
86         $(RM) $(TARGET)
88 STLIBS = ../scintilla/scintilla.a ../tagmanager/tagmanager.a ../tagmanager/mio/mio.a
90 $(TARGET): $(OBJS) $(RES) $(STLIBS)
91         $(CXX) $(OBJS) $(RES) -o $(TARGET) $(STLIBS) $(ALL_GTK_LIBS) $(WIN_LIBS)
93 deps.mak:
94         $(CC) -MM  $(CFLAGS) *.c >deps.mak
96 # Generate header dependencies with "make deps.mak"
97 include deps.mak
99 ..\localwin32.mk:
100         echo # Set local variables here >$@