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
18 DLANGFLAGS
+=-fproperty
19 DLANGFLAGS
+=-fdeprecated
# necessary because of octal literals in std lib...
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 LIBS_CLUTTER
= ${shell pkg-config
--libs clutter-1.0
}
45 example_clutter1
: gtk2
/glib2.o gtk2
/gobject2.o gtk2
/clutter.o
46 example_clutter1
: TLIBS
= ${LIBS_CLUTTER}
47 example_clutter2
: gtk2
/glib2.o gtk2
/gobject2.o gtk2
/clutter.o
48 example_clutter2
: TLIBS
= ${LIBS_CLUTTER}
50 LIBS_MX2
= ${shell pkg-config
--libs mx-2.0
}
52 example_mx3
: gtk2
/mx2.o gtk2
/glib2.o
#gtk2/gobject2.o gtk2/clutter.o
53 example_mx3
: TLIBS
= ${LIBS_MX2}
55 # WIP, static linking not tested yet:
56 static_exe
: gtk2
/glib2.o gtk2
/gmodule2.o gtk2
/gobject2.o gtk2
/gdk2.o gtk2
/gtk2.o
57 static_exe
: TDFLAGS
= -static
-fno-lto
58 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
}
59 static_exe
: example_gtk3.d
60 ${DC} ${DFLAGS} ${TDFLAGS} $^
${TLIBS} -o
$@
68 rm -f
${intermediates}
72 ${DC} ${DFLAGS} ${TDFLAGS} $^
${TLIBS} -o
$@
76 ${DC} ${DFLAGS} ${TDFLAGS} $^
-c
-o
$@