Skip to content

Commit a2a9fef

Browse files
committed
Build the libraries through library project files
We no longer use custom Makefiles. This simplifies the setup, and fixes some strange issues on my setup where I could run testgtk, but not test_rtrees for instance. N708-028 Remove all gtkextra-related files, since these are no longer supported in gtk3. N708-015
1 parent d83fab2 commit a2a9fef

File tree

146 files changed

+636
-66884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+636
-66884
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ src/Makefile.common
3131
src/config.h
3232
src/gtkada-intl.adb
3333
src/gtkextra/obj
34-
src/lib-obj
34+
src/lib
35+
src/obj
3536
src/gnome/obj/libgnomeada-*
3637
src/opengl/obj/libgtkada_gl-*
3738
src/tools/gate

Makefile.in

+147-25
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,155 @@ SHELL=/bin/sh
55
clean distclean mostlyclean maintainer-clean \
66
install src tests
77

8-
src_dir = src
98
testgtk_dir = testgtk
109
doc_dir = docs
1110
example_dir = examples
1211
projects_dir = projects
1312
xml_dir = xml
1413
PYTHON = python
14+
CP = cp -p -f
15+
MKDIR = mkdir -p
16+
CHMOD = chmod
17+
INSTALL = @INSTALL@
18+
INSTALL_PROGRAM = @INSTALL_PROGRAM@
19+
20+
ifeq (${OS}, Windows_NT)
21+
LN_S = ${CP}
22+
EXEEXT = .ext
23+
else
24+
LN_S = ln -s
25+
EXEEXT =
26+
endif
27+
28+
TARGET=@TARGET@
29+
ifeq ($(TARGET),)
30+
GPRBUILD=gprbuild
31+
else
32+
GPRBUILD=gprbuild --target=${TARGET}
33+
endif
34+
35+
# Number of parallel compilation
36+
PROCESSORS = 0
37+
38+
GPRBUILD_FULL = ${GPRBUILD} -j${PROCESSORS} -m -p
39+
40+
GETTEXT_INTL=@GETTEXT_INTL@
41+
HAVE_GETTEXT=@HAVE_GETTEXT@
42+
HAVE_OPENGL=@HAVE_OPENGL@
43+
BUILD_SHARED=@BUILD_SHARED@
44+
BUILD_STATIC=@BUILD_STATIC@
45+
TARNAME=@PACKAGE_TARNAME@
46+
VERSION=@PACKAGE_VERSION@
47+
DESTDIR=
48+
prefix=@prefix@
49+
exec_prefix=@exec_prefix@
50+
includedir=${DESTDIR}@includedir@
51+
libdir=${DESTDIR}@libdir@
52+
bindir=${DESTDIR}@bindir@
53+
datadir=${DESTDIR}@datadir@
54+
exampledir=${DESTDIR}${prefix}/share/examples/gtkada/testgtk
55+
gpsdir=${DESTDIR}${prefix}/share/gps/plug-ins/
56+
57+
all:
58+
59+
install: install_dirs
60+
61+
ifeq (${BUILD_STATIC}, yes)
62+
all: static
63+
install: install/static
64+
endif
65+
66+
ifeq (${BUILD_SHARED},yes)
67+
all: relocatable
68+
install: install/relocatable
69+
endif
70+
71+
all: tools tests
72+
static: build_library_type/static
73+
relocatable: build_library_type/relocatable
74+
75+
tools:
76+
@echo "====== Building tools ====="
77+
${GPRBUILD_FULL} -XLIBRARY_TYPE=static -Psrc/tools/tools.gpr
78+
79+
build_library_type/%: src/gtkada-intl.adb
80+
@echo "====== Building $(@F) libraries ====="
81+
${GPRBUILD_FULL} -XLIBRARY_TYPE=$(@F) -Psrc/gtkada_src.gpr
82+
ifeq (${HAVE_OPENGL}, True)
83+
${GPRBUILD_FULL} -XLIBRARY_TYPE=$(@F) -Psrc/opengl/opengl.gpr
84+
endif
85+
86+
src/gtkada-intl.adb: src/gtkada-intl.gpb Makefile
87+
gnatprep -DGETTEXT_INTL=$(GETTEXT_INTL) -DHAVE_GETTEXT=$(HAVE_GETTEXT) src/gtkada-intl.gpb $@
88+
89+
testgtk/opengl/view_gl.adb: testgtk/opengl/view_gl.gpb Makefile
90+
gnatprep -r -c -DHAVE_GL=${HAVE_OPENGL} -DWIN32=False testgtk/opengl/view_gl.gpb $@
91+
92+
tests: testgtk/opengl/view_gl.adb static
93+
@echo "====== Building tests ====="
94+
${GPRBUILD_FULL} -XLIBRARY_TYPE=static -Ptestgtk/testgtk.gpr
95+
96+
SRCDIRS=src/ src/generated/
97+
98+
install/static/%: force
99+
@${MKDIR} ${libdir}/${TARNAME}/static/
100+
${CP} src/lib/$(@F)/static/* ${libdir}/${TARNAME}/static/
101+
${CHMOD} ugo-w ${libdir}/${TARNAME}/static/*.ali
102+
103+
install/relocatable/%: force
104+
@${MKDIR} ${libdir}/${TARNAME}/relocatable/
105+
${CP} src/lib/${@F}/relocatable/* ${libdir}/${TARNAME}/relocatable
106+
${CHMOD} ugo-w ${libdir}/${TARNAME}/relocatable/*.ali
107+
cd ${libdir}; ${RM} lib$(@F)@SO_EXT@ lib$(@F)@SO_EXT@.${basename ${VERSION}} lib$(@F)@SO_EXT@.${VERSION}
108+
ifneq (${OS},Windows_NT)
109+
${RM} ${libdir}/${TARNAME}/relocatable/lib$(@F)@SO_EXT@
110+
${RM} ${libdir}/${TARNAME}/relocatable/lib$(@F)@SO_EXT@.${basename ${VERSION}}
111+
cd ${libdir}/${TARNAME}/relocatable; ${LN_S} lib$(@F)@SO_EXT@.${VERSION} lib$(@F)@SO_EXT@
112+
cd ${libdir}/${TARNAME}/relocatable; ${LN_S} lib$(@F)@SO_EXT@.${VERSION} lib$(@F)@SO_EXT@.${basename ${VERSION}}
113+
cd ${libdir}; ${LN_S} ${TARNAME}/relocatable/lib$(@F)@SO_EXT@.${VERSION} lib$(@F)@SO_EXT@.${basename ${VERSION}}
114+
cd ${libdir}; ${LN_S} ${TARNAME}/relocatable/lib$(@F)@SO_EXT@.${VERSION} lib$(@F)@SO_EXT@.${VERSION}
115+
else
116+
${CP} ${libdir}/${TARNAME}/relocatable/lib$(@F)@SO_EXT@ ${bindir}/
117+
endif
118+
119+
ifeq (${HAVE_OPENGL},True)
120+
install/static: install/static/gtkada_gl
121+
install/relocatable: install/relocatable/gtkada_gl
122+
endif
123+
124+
install/static: install/static/gtkada
125+
install/relocatable: install/relocatable/gtkada
126+
127+
install_dirs:
128+
${MKDIR} ${includedir}/${TARNAME}
129+
${MKDIR} ${DESTDIR}/${prefix}/lib/gnat/${TARNAME}
130+
${MKDIR} ${bindir}
131+
${MKDIR} ${gpsdir}
132+
${MKDIR} ${exampledir}
133+
134+
install:
135+
@${CP} ${wildcard ${addsuffix *.ad[bs], ${SRCDIRS}}} ${includedir}/${TARNAME}
136+
@cd ${includedir}/${TARNAME}; ls ${notdir ${wildcard ${addsuffix *.ad[bs], ${SRCDIRS}}}} > ${DESTDIR}${prefix}/lib/gnat/${TARNAME}/gtkada.lgpr
137+
138+
ifeq (${HAVE_OPENGL},True)
139+
@${CP} ${wildcard ${addsuffix *.ad[bs], src/opengl/}} ${includedir}/${TARNAME}
140+
@cd ${includedir}/${TARNAME}; ls ${notdir ${wildcard ${addsuffix *.ad[bs], src/opengl/}}} > ${DESTDIR}${prefix}/lib/gnat/${TARNAME}/gtkada_gl.lgpr
141+
endif
142+
143+
@# install executables
144+
${INSTALL_PROGRAM} src/tools/gtkada-config ${bindir}
145+
${INSTALL_PROGRAM} src/obj/tools/gtkada-dialog${EXEEXT} ${bindir}
146+
147+
@# install testgtk
148+
-${INSTALL_PROGRAM} testgtk/testgtk${EXEEXT} ${exampledir}
149+
${CP} testgtk/*.ad? testgtk/*.xpm testgtk/*.png testgtk/*.gif testgtk/*.lwo testgtk/*.xml testgtk/*.css ${exampledir}
15150

16-
all: src tests
17-
18-
src:
19-
$(MAKE) -C $(src_dir)
20-
21-
tests: src
22-
$(MAKE) -C $(testgtk_dir)
23-
24-
install:
25-
$(MAKE) -C $(src_dir) install
26151
$(MAKE) -C $(projects_dir) install
27-
$(MAKE) -C $(testgtk_dir) install
28152
$(MAKE) -C $(doc_dir) install
29-
#$(MAKE) -C $(example_dir) install
30-
$(MAKE) -C $(xml_dir) install
153+
154+
@# install GPS support
155+
${CP} xml/gtkada.xml ${gpsdir}
156+
31157
@echo '------------------------------------------------------------------'
32158
@echo '-- GtkAda has now been installed. --'
33159
@echo '-- To be able to use the library, you may need to update your --'
@@ -39,7 +165,6 @@ install:
39165
docs:
40166
$(MAKE) -C docs
41167

42-
43168
# Generate the binding automatically, through a python script
44169
generate: force
45170
${RM} src/generated/*.ad?
@@ -61,28 +186,25 @@ clean-generic:
61186

62187
mostlyclean-generic: clean-generic
63188
-${RM} Makefile
189+
-${RM} testgtk/Makefile
190+
191+
clean/%: force
192+
-gprclean -r -q -XLIBRARY_TYPE=$(@F) -Psrc/tools/tools.gpr
193+
-gprclean -r -q -XLIBRARY_TYPE=$(@F) -Psrc/opengl/opengl.gpr
194+
-gprclean -r -q -XLIBRARY_TYPE=$(@F) -Ptestgtk/testgtk.gpr
64195

65-
clean: clean-generic
66-
-$(MAKE) -C $(testgtk_dir) clean
67-
#-$(MAKE) -C $(example_dir) clean
68-
-$(MAKE) -C $(src_dir) clean
196+
clean: clean-generic clean/static clean/relocatable
69197

70198
distclean: mostlyclean-generic
71199
-${RM} config.cache config.log config.status
72-
-$(MAKE) -C $(testgtk_dir) distclean
73200
-$(MAKE) -C $(doc_dir) distclean
74201
-$(MAKE) -C $(projects_dir) distclean
75202
-$(MAKE) -C po distclean
76-
-$(MAKE) -C $(src_dir) distclean
77203

78204
mostlyclean: mostlyclean-generic
79-
-$(MAKE) -C $(testgtk_dir) mostlyclean
80-
-$(MAKE) -C $(src_dir) mostlyclean
81205

82206
maintainer-clean: mostlyclean-generic
83207
-${RM} config.cache config.log config.status
84208
-${RM} configure
85-
-$(MAKE) -C $(testgtk_dir) maintainer-clean
86-
-$(MAKE) -C $(src_dir) maintainer-clean
87209

88210
force:

0 commit comments

Comments
 (0)