4
SRC :=init types boxed data enum voidptr call closure gvalue lang \
5
debug object object_types object_meta \
6
hash-lookup hash-functions hash-simple
7
CLEAN =*.$O file2c override.luac ffi-types test-* lg_ffi.h cmph_types.h
9
all-gnome: build-tests module_$(MODULE) dummy
11
include script/Makefile.common
12
include src/hash/Makefile.inc
14
BINDIR :=build/$(ARCH)
22
# if DYNLINK==0, LIBS:=$(GTK_LIBS)
24
# ODLL :=gnome$(DLLEXT)
26
# test that calling works properly. For Win32, requires wine to be installed.
27
build-tests: ${ODIR}test-vararg-ok
29
${ODIR}test-%-ok: ${ODIR}test-%${EXESUFFIX}
30
$H $(CROSS_RUN) $^ && touch $@
32
${ODIR}test-vararg${EXESUFFIX}: $(IDIR)/test-vararg.c
34
$H $(CC) $(CFLAGS) -I $(ODIR) -Wall -o $@ $^
36
# rule to build the library.
38
${ODIR}debug.$(O): $(IDIR)/debug.c
40
$H ${CC} ${CFLAGS} -I lua-5.1/src -c -o $@ $<
45
${ODIR}lg_ffi.h: ${ODIR}ffi-types
47
$H ${ODIR}ffi-types > $@
49
${ODIR}ffi-types.$(O): $(IDIR)/ffi-types.c
51
$H ${HOSTCC} ${CFLAGS} -o $@ -c $<
53
${ODIR}ffi-types: ${ODIR}ffi-types.$(O)
55
$H ${HOSTCC} $(CFLAGS) -o $@ $< -lffi
57
# -- cmph hash functions --
59
$(ODIR)hash-cmph.$O: src/hash/hash-cmph.c
61
$H $(CC) $(CFLAGS) -c -o $@ $<
63
${ODIR}hash-fch.$(O): src/hash/hash-fch.c
65
$H ${CC} ${CMPH_CFLAGS} ${CFLAGS} -c -o $@ $<
67
${ODIR}hash-bdz.$(O): src/hash/hash-bdz.c
69
$H ${CC} ${CMPH_CFLAGS} ${CFLAGS} -c -o $@ $<
71
${ODIR}hash-functions.$O: src/hash/hash-functions.c
73
$H ${CC} ${CMPH_CFLAGS} ${CFLAGS} -c -o $@ $<
75
# -- hash generator helpers --
76
# these are not used to build this module, as no hash tables are used, but
77
# the other modules need this to build.
79
${ODIR}file2c: src/file2c.c
83
# -- special targets --
86
$H rm -f ${ODIR}types.c $(ODIR)fundamentals.c \
87
${ODIR}hash-fch-* ${ODIR}config.* \
88
${ODIR}types.xml ${ODIR}ffi-ofs ${ODIR}link.[ch] \
89
${ODIR}lg_ffi.h ${ODIR}cmph_types.h \
90
${ODIR}test-*-ok ${ODIR}test-*${EXESUFFIX}
92
# you need to be root for this!
94
$(LIBINSTALL) ${ODIR}${ODLL} $(INDIR1)/${ODLL}
96
mkdir -p $(INDIR2)/gtk
97
cp -a lib $(INDIR2)/gtk/
101
(cd ..; ln -s lua-gtk lua-gtk-${VERSION}; \
102
tar czvfh tar/lua-gtk-${VERSION}.tar.gz \
103
--exclude build --exclude CVS --exclude mingw \
104
--exclude tags --exclude ".*.swp" --exclude attic \
105
--exclude private --exclude win32 --exclude funclist \
106
lua-gtk-${VERSION}; \
107
rm lua-gtk-${VERSION})
110
@echo "Usage: make.sh [architecture] [target]"
111
@echo " architecture: optional, may be linux-i386, linux-amd64 or win32-i386"
112
@echo " target: optional, default is all, also known:"
113
@echo " help, doc, install, clean, mrproper and maybe more."
115
funclist: all $(ODIR)functions.txt
116
$H script/funclist.lua $(ODIR)functions.txt > $@
120
DEP +=$(IDIR)/luagnome.h include/common.h
122
${ODIR}call.$O: ${ODIR}lg_ffi.h $(DEP)
123
${ODIR}closure.$O: $(DEP)
124
${ODIR}data.$O: $(DEP)
125
${ODIR}debug.$O: $(DEP)
126
${ODIR}init.$O: $(DEP) include/module.h
127
${ODIR}boxed.$O: $(DEP)
128
${ODIR}types.$O: $(DEP)
129
${ODIR}gvalue.$O: $(DEP)
130
${ODIR}hash-functions.$O: $(DEP) include/lg-hash.h
131
${ODIR}hash-cmph.$O: $(DEP) include/lg-hash.h
132
${ODIR}hash-fch.$O: $(DEP) include/lg-hash.h
133
${ODIR}hash-bdz.$O: $(DEP) include/lg-hash.h
134
${ODIR}interface.$O: $(DEP)
135
${ODIR}override.$O: $(DEP)
136
${ODIR}types.$O: $(DEP) $(ODIR)fundamentals.c ${ODIR}lg_ffi.h
137
${ODIR}enum.$O: $(DEP)
138
${ODIR}voidptr.$O: $(DEP)
139
${ODIR}object.$O: $(DEP)
140
${ODIR}object_meta.$O: $(DEP)
141
${ODIR}object_types.$O: $(DEP)