Experimental GTK structs-as-references support. Not enabled by default.
[girtod.git] / Makefile
blob8c9b689e65efa6e82890169b5dc654ce23f6550a
2 #FIXME: only GDC support right now.
4 #GDCARCH=-m32 -march=i686 -mtune=corei7
5 DC=gdc ${GDCARCH}
7 #DC+=-ffunction-sections -fdata-sections -Wl,--gc-sections
9 # NOTE: -flto is needed for GDC to not emit function wrappers
10 # (which do nothing: "push %ebp; mov %esp,%ebp; pop %ebp; jmp <target>")
11 # To avoid these the binding modules need to be compiled w/ -flto too.
12 #DC+=-flto
14 DC+=-Wl,--export-dynamic # slows down linking, needed only for backtraces
16 DC+=-Wl,--as-needed
18 DLANGFLAGS+=-fproperty
19 DLANGFLAGS+=-fdeprecated # necessary because of octal literals in std lib...
20 DWARNFLAGS+=-Wall
21 DDEBUGFLAGS+=-g -fdebug-c
22 #DRELFLAGS=-frelease -fno-bounds-check
23 DFLAGS=-O3 ${DLANGFLAGS} ${DWARNFLAGS} ${DDEBUGFLAGS} ${DRELFLAGS}
25 dsources = $(wildcard *.d)
26 dtargets = $(patsubst %.d,%,${dsources})
28 intermediates = $(wildcard *.o) $(wildcard */*.o)
30 LIBS_GTK = ${shell pkg-config --libs gtk+-2.0}
32 testimports: gtk2/glib2.o
33 testimports: TLIBS = ${LIBS_GTK}
34 example_glib: gtk2/glib2.o
35 example_glib: TLIBS = ${LIBS_GTK}
36 example_gtk1: gtk2/glib2.o gtk2/gobject2.o gtk2/gtk2.o
37 example_gtk1: TLIBS = ${LIBS_GTK}
38 example_gtk2: gtk2/glib2.o gtk2/gobject2.o gtk2/gdk2.o gtk2/gtk2.o
39 example_gtk2: TLIBS = ${LIBS_GTK}
40 example_gtk3: gtk2/glib2.o gtk2/gobject2.o gtk2/gdk2.o gtk2/gtk2.o
41 example_gtk3: TLIBS = ${LIBS_GTK}
43 # WIP, static linking not tested yet:
44 static_exe: gtk2/glib2.o gtk2/gmodule2.o gtk2/gobject2.o gtk2/gdk2.o gtk2/gtk2.o
45 static_exe: TDFLAGS = -static -fno-lto
46 static_exe: TLIBS = ${shell pkg-config --static --libs gtk+-2.0} ${shell pkg-config --static --libs gmodule-2.0} ${shell pkg-config --static --libs gdk-pixbuf-2.0}
47 static_exe: example_gtk3.d
48 ${DC} ${DFLAGS} ${TDFLAGS} $^ ${TLIBS} -o $@
50 TARGETS= ${dtargets}
52 all: ${TARGETS}
54 clean:
55 rm -f core ${TARGETS}
56 rm -f ${intermediates}
58 .SECONDEXPANSION:
59 %:%.d $${ODEPS}
60 ${DC} ${DFLAGS} ${TDFLAGS} $^ ${TLIBS} -o $@
62 .SECONDARY:
63 %.o:%.d
64 ${DC} ${DFLAGS} ${TDFLAGS} $^ -c -o $@