2 #FIXME: only GDC support right now.
4 #GDCARCH=-m32 -march=i686 -mtune=corei7
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.
14 DC
+=-Wl
,--export-dynamic
# slows down linking, needed only for backtraces
16 # Using --as-needed sometimes results in link failures:
17 # 'libgphobos2.a(memory.o): undefined reference to symbol '_end';
18 # temp disabled until cause and a fix is found (a newer ld version
19 # may be the problem).
22 DLANGFLAGS
+=-fproperty
23 DLANGFLAGS
+=-fdeprecated
# necessary because of octal literals in std lib...
25 DDEBUGFLAGS
+=-g
-fdebug-c
26 #DRELFLAGS=-frelease -fno-bounds-check
27 DFLAGS
=-O3
${DLANGFLAGS} ${DWARNFLAGS} ${DDEBUGFLAGS} ${DRELFLAGS}
29 dsources
= $(wildcard *.d
)
30 dtargets
= $(patsubst %.d
,%,${dsources})
32 intermediates
= $(wildcard *.o
) $(wildcard */*.o
)
34 LIBS_GTK
= ${shell pkg-config
--libs gtk
+-2.0}
36 testimports
: gtk2
/glib2.o
37 testimports
: TLIBS
= ${LIBS_GTK}
38 example_glib
: gtk2
/glib2.o
39 example_glib
: TLIBS
= ${LIBS_GTK}
40 example_gtkraw
: gtk2
/glib2.o gtk2
/gobject2.o gtk2
/gtk2.o
41 example_gtkraw
: TLIBS
= ${LIBS_GTK}
42 example_gtkraw2
: gtk2
/glib2.o gtk2
/gobject2.o gtk2
/gdk2.o gtk2
/gtk2.o
43 example_gtkraw2
: TLIBS
= ${LIBS_GTK}
44 example_gtk
: gtk2
/glib2.o gtk2
/gobject2.o gtk2
/gdk2.o gtk2
/gtk2.o
45 example_gtk
: TLIBS
= ${LIBS_GTK}
47 LIBS_CLUTTER
= ${shell pkg-config
--libs clutter-1.0
}
49 example_clutter1
: gtk2
/glib2.o gtk2
/gobject2.o gtk2
/clutter.o
50 example_clutter1
: TLIBS
= ${LIBS_CLUTTER}
51 example_clutter2
: gtk2
/glib2.o gtk2
/gobject2.o gtk2
/clutter.o
52 example_clutter2
: TLIBS
= ${LIBS_CLUTTER}
54 LIBS_MX2
= ${shell pkg-config
--libs mx-2.0
}
56 example_mx
: gtk2
/mx2.o gtk2
/glib2.o
#gtk2/gobject2.o gtk2/clutter.o
57 example_mx
: TLIBS
= ${LIBS_MX2}
59 # WIP, static linking not tested yet:
60 static_exe
: gtk2
/glib2.o gtk2
/gmodule2.o gtk2
/gobject2.o gtk2
/gdk2.o gtk2
/gtk2.o
61 static_exe
: TDFLAGS
= -static
-fno-lto
62 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
}
63 static_exe
: example_gtk.d
64 ${DC} ${DFLAGS} ${TDFLAGS} $^
${TLIBS} -o
$@
72 rm -f
${intermediates}
76 ${DC} ${DFLAGS} ${TDFLAGS} $^
${TLIBS} -o
$@
80 ${DC} ${DFLAGS} ${TDFLAGS} $^
-c
-o
$@