1## Makefile for the toplevel directory of the libssp library.
2##
3## Copyright (C) 2005-2018 Free Software Foundation, Inc.
4##
5
6AUTOMAKE_OPTIONS = 1.9.5 foreign
7ACLOCAL_AMFLAGS = -I .. -I ../config
8MAINT_CHARSET = latin1
9
10# May be used by various substitution variables.
11gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
12
13if LIBSSP_USE_SYMVER
14if LIBSSP_USE_SYMVER_GNU
15version_arg = -Wl,--version-script=$(srcdir)/ssp.map
16version_dep = $(srcdir)/ssp.map
17endif
18if LIBSSP_USE_SYMVER_SUN
19version_arg = -Wl,-M,ssp.map-sun
20version_dep = ssp.map-sun
21ssp.map-sun : $(srcdir)/ssp.map \
22		$(top_srcdir)/../contrib/make_sunver.pl \
23		$(libssp_la_OBJECTS) $(libssp_la_LIBADD)
24	perl $(top_srcdir)/../contrib/make_sunver.pl \
25	  $(srcdir)/ssp.map \
26	  $(libssp_la_OBJECTS:%.lo=.libs/%.o) \
27	 `echo $(libssp_la_LIBADD) | \
28	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
29	 > $@ || (rm -f $@ ; exit 1)
30endif
31else
32version_arg =
33version_dep =
34endif
35
36AM_CFLAGS = -Wall
37AM_CFLAGS += $(XCFLAGS)
38
39toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la
40
41target_noncanonical = @target_noncanonical@
42libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
43nobase_libsubinclude_HEADERS = ssp/ssp.h ssp/string.h ssp/stdio.h ssp/unistd.h
44
45libssp_la_SOURCES = \
46	ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
47	memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \
48	strcat-chk.c strcpy-chk.c strncat-chk.c strncpy-chk.c \
49	vsnprintf-chk.c vsprintf-chk.c
50libssp_la_LIBADD =
51libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
52libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
53		    $(version_arg) $(lt_host_flags)
54
55libssp_nonshared_la_SOURCES = \
56	ssp-local.c
57libssp_nonshared_la_CFLAGS = -prefer-pic $(XCFLAGS)
58libssp_nonshared_la_LIBADD =
59libssp_nonshared_la_DEPENDENCIES = $(libssp_nonshared_la_LIBADD)
60libssp_nonshared_la_LDFLAGS = -static
61
62
63# XXX hack alert
64# From libffi/Makefile.am
65
66# Work around what appears to be a GNU make bug handling MAKEFLAGS
67# values defined in terms of make variables, as is the case for CC and
68# friends when we are called from the top level Makefile.
69AM_MAKEFLAGS = \
70	"AR_FLAGS=$(AR_FLAGS)" \
71	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
72	"CFLAGS=$(CFLAGS)" \
73	"CXXFLAGS=$(CXXFLAGS)" \
74	"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
75	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
76	"INSTALL=$(INSTALL)" \
77	"INSTALL_DATA=$(INSTALL_DATA)" \
78	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
79	"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
80	"JC1FLAGS=$(JC1FLAGS)" \
81	"LDFLAGS=$(LDFLAGS)" \
82	"LIBCFLAGS=$(LIBCFLAGS)" \
83	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
84	"MAKE=$(MAKE)" \
85	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
86	"PICFLAG=$(PICFLAG)" \
87	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
88	"SHELL=$(SHELL)" \
89	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
90	"exec_prefix=$(exec_prefix)" \
91	"infodir=$(infodir)" \
92	"libdir=$(libdir)" \
93	"prefix=$(prefix)" \
94	"includedir=$(includedir)" \
95	"AR=$(AR)" \
96	"AS=$(AS)" \
97	"CC=$(CC)" \
98	"CXX=$(CXX)" \
99	"LD=$(LD)" \
100	"LIBCFLAGS=$(LIBCFLAGS)" \
101	"NM=$(NM)" \
102	"PICFLAG=$(PICFLAG)" \
103	"RANLIB=$(RANLIB)" \
104	"DESTDIR=$(DESTDIR)"
105
106MAKEOVERRIDES=
107
108## ################################################################
109
110