File: Makefile.in

package info (click to toggle)
libflorist 2017-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,212 kB
  • sloc: ada: 11,902; ansic: 7,195; makefile: 137; sh: 18
file content (183 lines) | stat: -rw-r--r-- 5,338 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
# This builds the "Florist" implementation of POSIX.5b
#
# If you need to modify the "configure" file, you will need
# autoconf version 2.12, or maybe a later version will also work.
#
.POSIX:

VERSION=Florist-2017 (20170515)
GNATPREPFLAGS = -c -r
TARGET=@host_alias@

ifneq ($(TARGET),)
TARGET_OPTION=--target=$(TARGET)
TARGET_PREFIX=$(TARGET)-
endif

ifeq ($(TARGET),powerpc-elinos-linux)
TARGET_RUNNER=run-cross --target=ppc-elinos,5.1,qemu
endif

# configure substitutions
ADAFLAGS                                := @ADAFLAGS@
CFLAGS                                  := @CFLAGS@
CPPFLAGS                                := @CPPFLAGS@
LDFLAGS                                 := @LDFLAGS@
LIBRARY_TYPE_OPTION                     := @LIBRARY_TYPE_OPTION@
CC = @CC@
LIBS = @LIBS@
SIGNALS_GENERATED = @SIGNALS_GENERATED@
PREFIX = @prefix@

PROJECT_FLAGS = $(LIBRARY_TYPE_OPTION) @BUILD_TYPE_OPTION@ @THREADS_OPTION@ @RTS_OPTION@ $(TARGET_OPTION)
# Scenario variables and RTS selection must be passed consistently to
# project-aware tools gprbuild, gprinstall, and gprclean.

GNATPREP = $(TARGET_PREFIX)gnatprep
GPRBUILD = gprbuild
GPRBUILD_FLAGS =

GENDIR = gensrc
GENDIR_ON_TARGET=$(GENDIR)

# files generated by "configure" script

CONFIG_GENERATED = \
 Makefile\
 confsrc/config.h\
 confsrc/pconfig.h\
 gnatprep.config\
 pconfig.h.in

CONFIG_HISTORY = \
 config.cache\
 config.log\
 c-posix.log\
 c-posix-signals.log\
 configure.log\
 config.status\
 stamp-h

# files generated by "c-posix" program
C-POSIX_GENERATED = \
 $(GENDIR)/posix.ads\
 $(GENDIR)/posix-limits.ads\
 $(GENDIR)/posix-options.ads\
 $(GENDIR)/posix-c.ads

# files generated by "c-posix-signals" program (if present)

ifneq "$(strip $(SIGNALS_GENERATED))" ""
C-POSIX-SIGNALS_GENERATED = $(GENDIR)/$(SIGNALS_GENERATED)
else
C-POSIX-SIGNALS_GENERATED =
endif

GNATPREP_SOURCES = $(GENDIR)/posix-implementation.adb $(GENDIR)/threads/posix-timers-extensions.adb

GENERATED = $(C-POSIX_GENERATED) $(C-POSIX-SIGNALS_GENERATED) $(GNATPREP_SOURCES)

# all the executable programs
EXECUTABLES = c-posix c-posix-signals

# default target, get the gnat version and the system type and then
# set up files and call make again (in uname)

all: floristlib

#
# ------------------------------------
# configure-script
# ------------------------------------
#
# This first step should not need to be done during
# normal installation
#
configure: configure.in aclocal.m4
	autoconf
#
# ------------------------------------
# generation of OS dependent sources
# ------------------------------------
#
# Program c-posix generates some Ada package specs.
# It is supposed to be a "portable" POSIX C program.
# If it does not compile or does not link,
# it might be fixable by hand-editing config.h or pconfig.h.
# If you are unlucky, it will require fixes to c-posix.c.
#
c-posix: confsrc/config.h \
         confsrc/pconfig.h
c-posix: CPPFLAGS += -DVERSION="\"$(VERSION)\"" \
                     -DLIBS="\"$(LIBS)\"" \
                     -DGENDIR="\"$(GENDIR_ON_TARGET)\""
c-posix: LDLIBS += $(LIBS)
#
#
# Program c-posix-signals generates another Ada package spec.
#
c-posix-signals: CPPFLAGS += -DGENDIR="\"$(GENDIR_ON_TARGET)\""
c-posix-signals: LDLIBS += $(LIBS)
#
# generate Ada source files using "c-posix" program
#
$(C-POSIX_GENERATED): c-posix
	mkdir -p $(GENDIR) && cd $(GENDIR) && rm -f posix.ads posix-limits.ads posix-options.ads posix-c.ads
	# See file "c-posix.log" for results of this step.
	$(TARGET_RUNNER) ./c-posix > c-posix.log 2>&1
#
# generate Ada source files using "c-posix-signals" program
#
$(C-POSIX-SIGNALS_GENERATED): c-posix-signals
	mkdir -p $(GENDIR) && cd $(GENDIR) && rm -f posix-implementations-ok_signals.ads
	# See file "c-posix-signals.log" for results of this step.
	$(TARGET_RUNNER) ./c-posix-signals -nodefaults > c-posix-signals.log 2>&1

#
# Some other Ada source files are tailored to the
# particular OS using the "gnatprep" program.
# The sources for these end in ".gpb" and ".gps".
#
.SUFFIXES: .gps .gpb .ads .adb
$(GENDIR)/%.ads: libsrc/%.gps gnatprep.config
	mkdir -p `dirname $@` && $(GNATPREP) $< $@ gnatprep.config $(GNATPREPFLAGS)
$(GENDIR)/%.adb: libsrc/%.gpb gnatprep.config
	mkdir -p `dirname $@` && $(GNATPREP) $< $@ gnatprep.config $(GNATPREPFLAGS)

#
# ------------------------------------
# compilation of Florist packages
# ------------------------------------
#
force:

floristlib: $(GENERATED) force
	$(GPRBUILD) -P florist $(PROJECT_FLAGS) \
	  $(foreach v,ADAFLAGS CFLAGS CPPFLAGS LDFLAGS LIBS,"-X$(v)=$($(v))") \
	  -p $(GPRBUILD_FLAGS)
#
# -----------------------------------
# Maintenance targets
# -----------------------------------
#
# remove all c-posix and gnatprep generated files
regen:
	rm -f $(GENERATED)

# remove editor and compiler generated files
clean: regen
	gprclean -Pflorist $(PROJECT_FLAGS)
	rm -rf obj lib
	rm -f *# *~ $(EXECUTABLES) b__* b~*

# remove all generated files, including configuration history
distclean: clean
	rm -f $(CONFIG_HISTORY) $(CONFIG_GENERATED)

# install floristlib
# make all files read-only to prevent recompilation
install:
	gprinstall -Pflorist $(PROJECT_FLAGS) -a -p -f --prefix=$(PREFIX) --sources-subdir=floristlib --lib-subdir=floristlib --link-lib-subdir=floristlib
	chmod a-w $(PREFIX)/floristlib/*

.PHONY: all install clean distclean regen floristlib force