File: Makefile.in

package info (click to toggle)
libgtkada2 2.8.1-6lenny3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,496 kB
  • ctags: 3,886
  • sloc: ada: 103,189; ansic: 45,411; perl: 5,500; sh: 2,812; makefile: 1,169; xml: 19
file content (246 lines) | stat: -rw-r--r-- 7,565 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
SHELL=/bin/sh

.SUFFIXES:
.SUFFIXES: .c .o .ads .adb .ali

.PHONY:
.PHONY: clean-generic mostlyclean-generic \
	clean distclean mostlyclean maintainer-clean

include Makefile.common

MAKE_ADB = make_gtk

CFLAGS = -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS \
 @CFLAGS@ -Wall @GTK_CFLAGS@ -I.. $(FPIC)

GNATMAKEBINDFLAGS =
GNATMAKELDFLAGS = -largs -L. -lgtkada $(GTK_LIBS)

GETTEXT_INTL=@GETTEXT_INTL@
HAVE_GETTEXT=@HAVE_GETTEXT@

LIB_DIR=lib-obj

CD = cd
MKDIR = mkdir -p
RMDIR = rmdir
MV = mv
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@

LIBNAME       = libgtkada$(SO_EXT)
ifeq ($(OS),Windows_NT)
SONAME        = libgtkada-$(MAJOR).$(MINOR)$(SO_EXT)
else
SONAME        = libgtkada-$(MAJOR).$(MINOR)$(SO_EXT).$(MICRO)
endif
ARCHIVENAME   = libgtkada.a

GTKADA_CONFIG = gtkada-config
GATE_SRC      = gate.adb
GATE_EX       = gate-in.exe
GATE          = gate
GENERATE      = generate.pl
DGATE         = dgate
GDIALOG       = gdialog

c_objects = $(LIB_DIR)/misc.o $(LIB_DIR)/misc_extra.o $(LIB_DIR)/misc_broken.o
c_extra_objects = gtkextra/gtk*.o

## General and public targets

all: dirs libs tools

ifeq ($(BUILD_SHARED),yes)
libs: extra $(LIBNAME) $(ARCHIVENAME) opengl glade gnome install_ali
else
libs: extra $(ARCHIVENAME) opengl glade gnome install_ali
endif

opengl: force
	$(MAKE) -C opengl

extra: force
	$(MAKE) -C gtkextra

glade: force
	$(MAKE) -C glade

gnome: force
	$(MAKE) -C gnome

tools: $(GATE_EX) $(GDIALOG)

## Private targets

dirs:: force
	-$(MKDIR) $(LIB_DIR)
	-$(CHMOD) +x $(GATE) $(GTKADA_CONFIG)

$(LIBNAME):: $(LIB_DIR)/$(MAKE_ADB).o ${wildcard ${LIB_DIR}/*.o} $(c_objects)
ifeq ($(BUILD_SHARED),yes)
	$(CC) -shared $(FPIC) $(OS_SPECIFIC_LINK_OPTIONS) -o $(SONAME) \
	  $(SO_OPTS)$(SONAME) $(LIB_DIR)/glib*.o $(LIB_DIR)/gdk*.o \
	  $(LIB_DIR)/gtk*.o $(LIB_DIR)/pango*.o \
	  $(c_objects) $(c_extra_objects) $(GTK_LIBS)
	$(RM) $(LIBNAME)
	$(LN) $(SONAME) $(LIBNAME)
ifeq ($(OS),Windows_NT)
	-@if [ ! -f .devel ]; then \
	  $(CHMOD) +x $(SONAME) $(LIBNAME); \
	fi
else
	-@if [ ! -f .devel ]; then \
	  strip $(LIBNAME); \
	  $(CHMOD) +x $(LIBNAME); \
	fi
endif
endif

$(ARCHIVENAME):: $(LIB_DIR)/$(MAKE_ADB).o ${wildcard ${LIB_DIR}/*.o} $(c_objects)
	$(AR) $(ARFLAGS) $(ARCHIVENAME) $(LIB_DIR)/glib*.o $(LIB_DIR)/gdk*.o $(LIB_DIR)/gtk*.o $(LIB_DIR)/pango*.o $(c_objects) $(c_extra_objects)
	-$(RANLIB) $(ARCHIVENAME)

# This copies the .ali files from lib_obj/ to the current directory, and change
# the permission of the files so that dgate, gate and testgtk use the dynamic
# library. We do not do this if .devel exists, so that gnatmake will still
# rebuild the files (it does not check anything if the .ali files are read-only.
install_ali::
	test -f .devel || $(CP) $(LIB_DIR)/*.ali .
	test -f .devel || $(CHMOD) -w glib*.ali gdk*.ali gtk*.ali pango*.ali

$(GATE_EX):: $(GATE_SRC) $(LIBNAME) force
	@if [ -f .devel ]; then \
	  $(GNATMAKE) -aO$(LIB_DIR) $(GNATFLAGS_DEVEL) -o $(GATE_EX) $(GATE_SRC) $(GNATMAKEBINDFLAGS) $(GNATMAKELDFLAGS); \
	else \
	  $(GNATMAKE) $(GNATFLAGS) -o $(GATE_EX) $(GATE_SRC) $(GNATMAKEBINDFLAGS) $(GNATMAKELDFLAGS); \
	fi

$(DGATE):: $(DGATE).adb $(LIBNAME) glade
	@if [ -f .devel ]; then \
	   $(GNATMAKE) -aO$(LIB_DIR) -Iglade $(GNATFLAGS_DEVEL) $(DGATE) $(GNATMAKEBINDFLAGS) $(GNATMAKELDFLAGS); \
	else \
	   $(GNATMAKE) -Iglade $(GNATFLAGS) $(DGATE) $(GNATMAKEBINDFLAGS) $(GNATMAKELDFLAGS); \
	fi

$(GDIALOG):: $(GDIALOG).adb $(LIBNAME)
	@if [ -f .devel ]; then \
	   $(GNATMAKE) -aO$(LIB_DIR) $(GNATFLAGS_DEVEL) $(GDIALOG) $(GNATMAKEBINDFLAGS) $(GNATMAKELDFLAGS); \
	else \
	   $(GNATMAKE) $(GNATFLAGS) $(GDIALOG) $(GNATMAKEBINDFLAGS) $(GNATMAKELDFLAGS); \
	fi

$(LIB_DIR)/$(MAKE_ADB).o:: gtkada-intl.adb force
	@if [ -f .devel ]; then \
	  $(CD) $(LIB_DIR); \
	  $(GNATMAKE) -c ../$(MAKE_ADB) $(GNATFLAGS_DEVEL) $(FPIC); \
	else \
	  $(CD) $(LIB_DIR); \
	  $(GNATMAKE) -c ../$(MAKE_ADB) $(GNATFLAGS) $(FPIC); \
	fi

gtkada-intl.adb: gtkada-intl.gpb Makefile
	gnatprep -DGETTEXT_INTL=$(GETTEXT_INTL) \
	  -DHAVE_GETTEXT=$(HAVE_GETTEXT) gtkada-intl.gpb gtkada-intl.adb

install: all
	@if [ "$(prefix)" != `pwd` ]; then \
	   echo Installing GtkAda in $(prefix); \
	   $(MKDIR) $(bindir); \
	   $(MKDIR) $(libdir); \
	   $(MKDIR) $(incdir); \
	   $(MKDIR) $(alidir); \
	   $(INSTALL_DATA) $(ARCHIVENAME) $(alidir); \
	   $(RM) $(libdir)/$(ARCHIVENAME); \
	   if [ -f /usr/bin/$(RANLIB) -o -f /bin/$(RANLIB) ]; then \
	     $(RANLIB) $(alidir)/$(ARCHIVENAME); \
	   fi; \
	   if [ $(BUILD_SHARED) = yes ]; then \
		if [ "$(OS)" = "Windows_NT" ]; then \
		     $(INSTALL_DATA) $(SONAME) $(bindir); \
		     $(INSTALL_DATA) $(SONAME) $(alidir); \
		     $(CHMOD) +x $(bindir)/$(SONAME) $(alidir)/$(SONAME); \
		else \
		     $(INSTALL_DATA) $(SONAME) $(alidir); \
		     $(RM) $(libdir)/$(LIBNAME); \
		     $(LN) $(SONAME) $(alidir)/$(LIBNAME); \
		     $(LN) gtkada/$(SONAME) $(libdir)/$(LIBNAME); \
		     $(LN) gtkada/$(SONAME) $(libdir)/$(SONAME); \
		fi; \
	   fi; \
	   $(CP) glib*.ads glib*.adb $(MESA_SPECS) $(incdir); \
	   $(CP) gdk*.ads gdk*.adb $(incdir); \
	   $(CP) gtk*.ads gtk*.adb $(incdir); \
	   $(CP) pango*.ads pango*.adb $(incdir); \
	   $(CP) $(LIB_DIR)/glib*.ali $(LIB_DIR)/gdk*.ali $(LIB_DIR)/gtk*.ali $(LIB_DIR)/pango*.ali $(alidir); \
	   $(CHMOD) ugo-w $(alidir)/*.ali; \
	   $(INSTALL_SCRIPT) $(GTKADA_CONFIG) $(bindir); \
           $(INSTALL_SCRIPT) $(GATE) $(bindir); \
           $(INSTALL_SCRIPT) $(GENERATE) $(bindir); \
           $(INSTALL_PROGRAM) $(GATE_EX) $(bindir); \
           $(INSTALL_PROGRAM) $(GDIALOG) $(bindir); \
           $(MAKE) -C opengl install; \
           $(MAKE) -C glade install; \
           $(MAKE) -C gnome install; \
	fi
	@echo '------------------------------------------------------------------'
	@echo '--  GtkAda has now been installed.                              --'
	@echo '--  To be able to use the library, you may need to update your  --'
	@echo '--  LD_LIBRARY_PATH or to run ldconfig. You may also need to    --'
	@echo '--  update your PATH to include gtkada-config in it.            --'
	@echo '------------------------------------------------------------------'

clean-generic:
	-${RM} *.o *.ali *~ b_*.c b~*.ad? core
	-$(RM) $(LIB_DIR)/*
	-${RM} $(ARCHIVENAME) $(LIBNAME) $(SONAME)
	-${RM} $(GATE_EX) $(DGATE) $(GDIALOG)
	-${RM} .\#*

mostlyclean-generic: clean-generic
	-${RM} Makefile
	-${RM} $(GATE)
	-${RM} $(GTKADA_CONFIG)

clean: clean-generic
	$(MAKE) -C gtkextra clean
	$(MAKE) -C opengl clean
	$(MAKE) -C glade clean
	$(MAKE) -C gnome clean

distclean: mostlyclean-generic
	$(MAKE) -C gtkextra distclean
	$(MAKE) -C opengl distclean
	$(MAKE) -C glade distclean
	$(MAKE) -C gnome distclean
	-$(RM) Makefile.common

mostlyclean: mostlyclean-generic
	$(MAKE) -C gtkextra mostlyclean
	$(MAKE) -C opengl mostlyclean
	$(MAKE) -C glade mostlyclean
	$(MAKE) -C gnome mostlyclean
	-$(RM) Makefile.common

maintainer-clean: mostlyclean-generic
	$(MAKE) -C gtkextra maintainer-clean
	$(MAKE) -C opengl maintainer-clean
	$(MAKE) -C glade maintainer-clean
	$(MAKE) -C gnome maintainer-clean
	-$(RM) Makefile.common

## Find the list of bindings that are not up-to-date
bindings_not_up_to_date:
	@egrep -L "2.8.17|gtkextra 2.1.1|glib 2.10" *.ads | grep -v gtkada | grep -v b~ | grep -v dgate_callbacks

## Building the C files: they all depend on the c file in the source directory
## The dependencies on the .h files have to be given explicitly

$(c_objects): $(LIB_DIR)/%.o : %.c
	$(CD) $(LIB_DIR); $(CC) -c $(CFLAGS) ../$<

force: