Home | History | Annotate | Line # | Download | only in libssp
      1 ## Makefile for the toplevel directory of the libssp library.
      2 ##
      3 ## Copyright (C) 2005-2024 Free Software Foundation, Inc.
      4 ##
      5 
      6 AUTOMAKE_OPTIONS = foreign
      7 ACLOCAL_AMFLAGS = -I .. -I ../config
      8 MAINT_CHARSET = latin1
      9 
     10 # May be used by various substitution variables.
     11 gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
     12 
     13 if LIBSSP_USE_SYMVER
     14 if LIBSSP_USE_SYMVER_GNU
     15 version_arg = -Wl,--version-script=$(srcdir)/ssp.map
     16 version_dep = $(srcdir)/ssp.map
     17 endif
     18 if LIBSSP_USE_SYMVER_SUN
     19 version_arg = -Wl,-M,ssp.map-sun
     20 version_dep = ssp.map-sun
     21 ssp.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)
     30 endif
     31 else
     32 version_arg =
     33 version_dep =
     34 endif
     35 
     36 AM_CFLAGS = -Wall
     37 AM_CFLAGS += $(XCFLAGS)
     38 
     39 toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la
     40 
     41 target_noncanonical = @target_noncanonical@
     42 libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
     43 nobase_libsubinclude_HEADERS = ssp/ssp.h ssp/string.h ssp/stdio.h ssp/unistd.h
     44 
     45 libssp_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
     50 libssp_la_LIBADD = 
     51 libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
     52 if ENABLE_DARWIN_AT_RPATH
     53 libssp_darwin_rpath = -Wc,-nodefaultrpaths
     54 libssp_darwin_rpath += -Wl,-rpath,@loader_path
     55 endif
     56 libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
     57 		    $(version_arg) $(lt_host_flags) $(libssp_darwin_rpath)
     58 
     59 libssp_nonshared_la_SOURCES = \
     60 	ssp-local.c
     61 libssp_nonshared_la_CFLAGS = -prefer-pic $(XCFLAGS)
     62 libssp_nonshared_la_LIBADD = 
     63 libssp_nonshared_la_DEPENDENCIES = $(libssp_nonshared_la_LIBADD)
     64 libssp_nonshared_la_LDFLAGS = -static
     65 
     66 
     67 # XXX hack alert
     68 # From libffi/Makefile.am
     69 
     70 # Work around what appears to be a GNU make bug handling MAKEFLAGS
     71 # values defined in terms of make variables, as is the case for CC and
     72 # friends when we are called from the top level Makefile.
     73 AM_MAKEFLAGS = \
     74 	"AR_FLAGS=$(AR_FLAGS)" \
     75 	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
     76 	"CFLAGS=$(CFLAGS)" \
     77 	"CXXFLAGS=$(CXXFLAGS)" \
     78 	"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
     79 	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
     80 	"EXPECT=$(EXPECT)" \
     81 	"INSTALL=$(INSTALL)" \
     82 	"INSTALL_DATA=$(INSTALL_DATA)" \
     83 	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
     84 	"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
     85 	"JC1FLAGS=$(JC1FLAGS)" \
     86 	"LDFLAGS=$(LDFLAGS)" \
     87 	"LIBCFLAGS=$(LIBCFLAGS)" \
     88 	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
     89 	"MAKE=$(MAKE)" \
     90 	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
     91 	"PICFLAG=$(PICFLAG)" \
     92 	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
     93 	"SHELL=$(SHELL)" \
     94 	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
     95 	"exec_prefix=$(exec_prefix)" \
     96 	"infodir=$(infodir)" \
     97 	"libdir=$(libdir)" \
     98 	"prefix=$(prefix)" \
     99 	"includedir=$(includedir)" \
    100 	"AR=$(AR)" \
    101 	"AS=$(AS)" \
    102 	"CC=$(CC)" \
    103 	"CXX=$(CXX)" \
    104 	"LD=$(LD)" \
    105 	"LIBCFLAGS=$(LIBCFLAGS)" \
    106 	"NM=$(NM)" \
    107 	"PICFLAG=$(PICFLAG)" \
    108 	"RANLIB=$(RANLIB)" \
    109 	"DESTDIR=$(DESTDIR)"
    110 
    111 MAKEOVERRIDES=
    112 
    113 ## ################################################################
    114 
    115 include $(top_srcdir)/../multilib.am
    116