diff options
Diffstat (limited to 'libc')
41 files changed, 507 insertions, 1273 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 0c73fcab3..eab86c0e8 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -647,7 +647,7 @@ int __form_query(int id, const char *name, int type, unsigned char *packet, } #endif -#ifdef L_dnslookup +#if defined(L_dnslookup) || defined(L_gethostent) #ifdef __UCLIBC_HAS_THREADS__ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; @@ -657,6 +657,9 @@ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; # define LOCK # define UNLOCK #endif +#endif + +#ifdef L_dnslookup /* Just for the record, having to lock __dns_lookup() just for these two globals * is pretty lame. I think these two variables can probably be de-global-ized, @@ -1587,15 +1590,6 @@ int __read_etc_hosts_r(FILE * fp, const char * name, int type, #ifdef L_gethostent -#ifdef __UCLIBC_HAS_THREADS__ -static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; -# define LOCK __pthread_mutex_lock(&mylock) -# define UNLOCK __pthread_mutex_unlock(&mylock); -#else -# define LOCK -# define UNLOCK -#endif - static int __stay_open; static FILE * __gethostent_fp; diff --git a/libc/inet/rpc/rpc_thread.c b/libc/inet/rpc/rpc_thread.c index e3a1c40b2..374aac84c 100644 --- a/libc/inet/rpc/rpc_thread.c +++ b/libc/inet/rpc/rpc_thread.c @@ -2,11 +2,12 @@ #include <features.h> #include <stdio.h> #include <assert.h> -#include <bits/libc-tsd.h> #include "rpc_private.h" #ifdef __UCLIBC_HAS_THREADS__ +#include <bits/libc-tsd.h> + /* Variable used in non-threaded applications or for the first thread. */ static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem; #ifdef __UCLIBC_HAS_THREADS_NATIVE__ diff --git a/libc/misc/file/lockf64.c b/libc/misc/file/lockf64.c index 327707ac8..5638d6938 100644 --- a/libc/misc/file/lockf64.c +++ b/libc/misc/file/lockf64.c @@ -38,8 +38,10 @@ #include <fcntl.h> #include <errno.h> #include <string.h> +#include <sys/syscall.h> #ifdef __NR_fcntl64 +extern int fcntl64 (int fd, int cmd, ...); #define flock flock64 #define fcntl fcntl64 #define F_GETLK F_GETLK64 diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c index 605e07cd5..e58c3e6ca 100644 --- a/libc/misc/ftw/ftw.c +++ b/libc/misc/ftw/ftw.c @@ -23,7 +23,9 @@ #if defined (__UCLIBC_HAS_LFS__) && defined L_ftw64 +#ifndef L_ftw #define L_ftw +#endif /* If Large file support is enabled, transparently remap * things to use the 64-bit interfaces */ diff --git a/libc/misc/internals/Makefile b/libc/misc/internals/Makefile index 1df05a934..8978fb808 100644 --- a/libc/misc/internals/Makefile +++ b/libc/misc/internals/Makefile @@ -37,7 +37,7 @@ endif OBJ_LIST=../../obj.misc.internals -all: $(OBJ_LIST) interp.o static.o +all: $(OBJ_LIST) interp.o $(OBJ_LIST): $(OBJS) echo $(patsubst %, misc/internals/%, $(OBJS)) > $(OBJ_LIST) diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 9dad20efa..c3f8a548c 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -25,20 +25,30 @@ #include <fcntl.h> #include <sys/stat.h> #include <sys/sysmacros.h> + +#ifndef SHARED +void *__libc_stack_end=NULL; + +/* probably all the weak_*function stuff below should be in here */ + #ifdef __UCLIBC_HAS_SSP__ -#include <ssp-internal.h> +#include <dl-osinfo.h> +#ifndef THREAD_SET_STACK_GUARD +/* Only exported for architectures that don't store the stack guard canary + * in thread local area. */ #include <stdint.h> - -/* for gcc-3.x + Etoh ssp */ -uintptr_t __guard attribute_relro; /* for gcc-4.1 non-TLS */ uintptr_t __stack_chk_guard attribute_relro; +/* for gcc-3.x + Etoh ssp */ +strong_alias(__stack_chk_guard,__guard) #endif +#endif + +#endif /* !SHARED */ /* * Prototypes. */ -extern void *__libc_stack_end; extern void weak_function _stdio_init(void); extern int *weak_const_function __errno_location(void); extern int *weak_const_function __h_errno_location(void); @@ -49,10 +59,6 @@ extern void weak_function _locale_init(void); extern void weak_function __pthread_initialize_minimal(void); #endif - - - - /* * Declare the __environ global variable and create a weak alias environ. * Note: Apparently we must initialize __environ to ensure that the weak @@ -64,7 +70,6 @@ weak_alias(__environ, environ); size_t __pagesize = 0; const char *__progname = 0; - #ifndef O_NOFOLLOW # define O_NOFOLLOW 0 #endif @@ -110,61 +115,6 @@ static int __check_suid(void) return 1; } -#ifdef __UCLIBC_HAS_SSP__ -static __always_inline uintptr_t _dl_guard_setup(void) -{ - uintptr_t ret; -#ifndef __SSP_QUICK_CANARY__ - - size_t size; - -# ifdef __SSP_USE_ERANDOM__ - { - int mib[3]; - /* Random is another depth in Linux, hence an array of 3. */ - mib[0] = CTL_KERN; - mib[1] = KERN_RANDOM; - mib[2] = RANDOM_ERANDOM; - - if (SYSCTL(mib, 3, &ret, &size, NULL, 0) != (-1)) - if (size == (size_t) sizeof(ret)) - return ret; - } -# endif /* ifdef __SSP_USE_ERANDOM__ */ - { - int fd; - -# ifdef __SSP_USE_ERANDOM__ - /* - * Attempt to open kernel pseudo random device if one exists before - * opening urandom to avoid system entropy depletion. - */ - if ((fd = OPEN("/dev/erandom", O_RDONLY)) == (-1)) -# endif - fd = OPEN("/dev/urandom", O_RDONLY); - if (fd >= 0) { - size = READ(fd, &ret, sizeof(ret)); - CLOSE(fd); - if (size == (size_t) sizeof(ret)) - return ret; - } - } -#endif /* ifndef __SSP_QUICK_CANARY__ */ - - /* Start with the "terminator canary". */ - ret = 0xFF0A0D00UL; - - /* Everything failed? Or we are using a weakened model of the - * terminator canary */ - { - struct timeval tv; - if (GETTIMEOFDAY(&tv, NULL) != (-1)) - ret ^= tv.tv_usec ^ tv.tv_sec; - } - return ret; -} -#endif /* __UCLIBC_HAS_SSP__ */ - /* __uClibc_init completely initialize uClibc so it is ready to use. * * On ELF systems (with a dynamic loader) this function must be called @@ -199,12 +149,16 @@ void __uClibc_init(void) __pthread_initialize_minimal(); #endif -#ifdef __UCLIBC_HAS_SSP__ - uintptr_t stack_chk_guard = _dl_guard_setup(); - /* for gcc-3.x + Etoh ssp */ - __guard = stack_chk_guard; - /* for gcc-4.1 non-TLS */ +#ifndef SHARED +# ifdef __UCLIBC_HAS_SSP__ + /* Set up the stack checker's canary. */ + uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard(); +# ifdef THREAD_SET_STACK_GUARD + THREAD_SET_STACK_GUARD (stack_chk_guard); +# else __stack_chk_guard = stack_chk_guard; +# endif +# endif #endif #ifdef __UCLIBC_HAS_LOCALE__ @@ -241,7 +195,10 @@ __uClibc_main(int (*main)(int, char **, char **), int argc, unsigned long *aux_dat; ElfW(auxv_t) auxvt[AT_EGID + 1]; #endif + +#ifndef SHARED __libc_stack_end = stack_end; +#endif __rtld_fini = rtld_fini; diff --git a/libc/misc/internals/static.c b/libc/misc/internals/static.c deleted file mode 100644 index cd39ffdd7..000000000 --- a/libc/misc/internals/static.c +++ /dev/null @@ -1,4 +0,0 @@ -#include <stddef.h> - -/* Force static libraries to know about ... */ -void *__libc_stack_end=NULL; diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index 914277698..c315baddc 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -2005,7 +2005,7 @@ int utimes(const char *filename, register const struct timeval *tvp) /**********************************************************************/ #ifdef L__time_t2tm -static const uint16_t vals[] = { +static const uint16_t _vals[] = { 60, 60, 24, 7 /* special */, 36524, 1461, 365, 0 }; @@ -2037,7 +2037,7 @@ struct tm *_time_t2tm(const time_t *__restrict timer, t = *timer; p = (int *) result; p[7] = 0; - vp = vals; + vp = _vals; do { if ((v = *vp) == 7) { /* Overflow checking, assuming time_t is long int... */ @@ -2182,7 +2182,7 @@ time_t _time_mktime(struct tm *timeptr, int store_on_success) /**********************************************************************/ #ifdef L__time_mktime_tzi -static const unsigned char vals[] = { +static const unsigned char __vals[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, /* non-leap */ 29, }; @@ -2221,7 +2221,7 @@ time_t _time_mktime_tzi(struct tm *timeptr, int store_on_success, --p[5]; } - s = vals; + s = __vals; d = (p[5] += 1900); /* Correct year. Now between 1900 and 2300. */ if (__isleap(d)) { s += 11; diff --git a/libc/pwd_grp/pwd_grp.c b/libc/pwd_grp/pwd_grp.c index e56b545d6..0225c6c7e 100644 --- a/libc/pwd_grp/pwd_grp.c +++ b/libc/pwd_grp/pwd_grp.c @@ -1,18 +1,7 @@ -/* Copyright (C) 2003 Manuel Novoa III +/* + * Copyright (C) 2003 Manuel Novoa III * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details. */ /* Nov 6, 2003 Initial version. @@ -229,6 +218,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->pw_name, key)) #define DO_GETXXKEY_R_KEYTYPE const char *__restrict #define DO_GETXXKEY_R_PATHNAME _PATH_PASSWD +#include "pwd_grp_internal.c" #endif #ifdef L_getgrnam_r @@ -238,6 +228,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->gr_name, key)) #define DO_GETXXKEY_R_KEYTYPE const char *__restrict #define DO_GETXXKEY_R_PATHNAME _PATH_GROUP +#include "pwd_grp_internal.c" #endif #ifdef L_getspnam_r @@ -247,6 +238,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->sp_namp, key)) #define DO_GETXXKEY_R_KEYTYPE const char *__restrict #define DO_GETXXKEY_R_PATHNAME _PATH_SHADOW +#include "pwd_grp_internal.c" #endif #ifdef L_getpwuid_r @@ -256,6 +248,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) ((ENT)->pw_uid == key) #define DO_GETXXKEY_R_KEYTYPE uid_t #define DO_GETXXKEY_R_PATHNAME _PATH_PASSWD +#include "pwd_grp_internal.c" #endif #ifdef L_getgrgid_r @@ -265,48 +258,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) ((ENT)->gr_gid == key) #define DO_GETXXKEY_R_KEYTYPE gid_t #define DO_GETXXKEY_R_PATHNAME _PATH_GROUP +#include "pwd_grp_internal.c" #endif /**********************************************************************/ -#ifdef GETXXKEY_R_FUNC - -int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key, - GETXXKEY_R_ENTTYPE *__restrict resultbuf, - char *__restrict buffer, size_t buflen, - GETXXKEY_R_ENTTYPE **__restrict result) -{ - FILE *stream; - int rv; - - *result = NULL; - - if (!(stream = fopen(DO_GETXXKEY_R_PATHNAME, "r"))) { - rv = errno; - } else { - __STDIO_SET_USER_LOCKING(stream); - do { - if (!(rv = __pgsreader(GETXXKEY_R_PARSER, resultbuf, - buffer, buflen, stream)) - ) { - if (GETXXKEY_R_TEST(resultbuf)) { /* Found key? */ - *result = resultbuf; - break; - } - } else { - if (rv == ENOENT) { /* end-of-file encountered. */ - rv = 0; - } - break; - } - } while (1); - fclose(stream); - } - - return rv; -} - -#endif -/**********************************************************************/ #ifdef L_getpwuid struct passwd *getpwuid(uid_t uid) @@ -446,16 +401,19 @@ int getpw(uid_t uid, char *buf) #endif /**********************************************************************/ -#ifdef L_getpwent_r +#if defined(L_getpwent_r) || defined(L_getgrent_r) || defined(L_getspent_r) #ifdef __UCLIBC_HAS_THREADS__ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; # define LOCK __pthread_mutex_lock(&mylock) # define UNLOCK __pthread_mutex_unlock(&mylock); -#else +#else # define LOCK ((void) 0) # define UNLOCK ((void) 0) -#endif +#endif +#endif + +#ifdef L_getpwent_r static FILE *pwf /*= NULL*/; @@ -512,15 +470,6 @@ int getpwent_r(struct passwd *__restrict resultbuf, /**********************************************************************/ #ifdef L_getgrent_r -#ifdef __UCLIBC_HAS_THREADS__ -static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; -# define LOCK __pthread_mutex_lock(&mylock) -# define UNLOCK __pthread_mutex_unlock(&mylock); -#else -# define LOCK ((void) 0) -# define UNLOCK ((void) 0) -#endif - static FILE *grf /*= NULL*/; void setgrent(void) @@ -575,15 +524,6 @@ int getgrent_r(struct group *__restrict resultbuf, /**********************************************************************/ #ifdef L_getspent_r -#ifdef __UCLIBC_HAS_THREADS__ -static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; -# define LOCK __pthread_mutex_lock(&mylock) -# define UNLOCK __pthread_mutex_unlock(&mylock); -#else -# define LOCK ((void) 0) -# define UNLOCK ((void) 0) -#endif - static FILE *spf /*= NULL*/; void setspent(void) @@ -695,7 +635,7 @@ struct spwd *sgetspent(const char *string) int initgroups(const char *user, gid_t gid) { - FILE *grf; + FILE *grfile; gid_t *group_list; int num_groups, rv; char **m; @@ -706,15 +646,15 @@ int initgroups(const char *user, gid_t gid) /* We alloc space for 8 gids at a time. */ if (((group_list = (gid_t *) malloc(8*sizeof(gid_t *))) != NULL) - && ((grf = fopen(_PATH_GROUP, "r")) != NULL) + && ((grfile = fopen(_PATH_GROUP, "r")) != NULL) ) { - __STDIO_SET_USER_LOCKING(grf); + __STDIO_SET_USER_LOCKING(grfile); *group_list = gid; num_groups = 1; - while (!__pgsreader(__parsegrent, &group, buff, sizeof(buff), grf)) { + while (!__pgsreader(__parsegrent, &group, buff, sizeof(buff), grfile)) { assert(group.gr_mem); /* Must have at least a NULL terminator. */ if (group.gr_gid != gid) { for (m=group.gr_mem ; *m ; m++) { @@ -738,7 +678,7 @@ int initgroups(const char *user, gid_t gid) rv = setgroups(num_groups, group_list); DO_CLOSE: - fclose(grf); + fclose(grfile); } /* group_list will be NULL if initial malloc failed, which may trigger @@ -825,7 +765,7 @@ int putgrent(const struct group *__restrict p, FILE *__restrict f) /**********************************************************************/ #ifdef L_putspent -static const unsigned char sp_off[] = { +static const unsigned char _sp_off[] = { offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */ offsetof(struct spwd, sp_min), /* 3 - not a char ptr */ offsetof(struct spwd, sp_max), /* 4 - not a char ptr */ @@ -853,9 +793,9 @@ int putspent(const struct spwd *p, FILE *stream) goto DO_UNLOCK; } - for (i=0 ; i < sizeof(sp_off) ; i++) { + for (i=0 ; i < sizeof(_sp_off) ; i++) { f = ld_format; - if ((x = *(const long int *)(((const char *) p) + sp_off[i])) == -1) { + if ((x = *(const long int *)(((const char *) p) + _sp_off[i])) == -1) { f += 3; } if (fprintf(stream, f, x) < 0) { diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c index a749955e2..eab6db24a 100644 --- a/libc/stdlib/stdlib.c +++ b/libc/stdlib/stdlib.c @@ -396,8 +396,10 @@ __XL_ALIAS(strtoull) /**********************************************************************/ #if defined(L__stdlib_wcsto_l) || defined(L__stdlib_wcsto_l_l) +#ifndef L__stdlib_strto_l #define L__stdlib_strto_l #endif +#endif #if defined(L__stdlib_strto_l) || defined(L__stdlib_strto_l_l) @@ -538,8 +540,10 @@ unsigned long __XL_NPP(_stdlib_strto_l)(register const Wchar * __restrict str, #endif /**********************************************************************/ #if defined(L__stdlib_wcsto_ll) || defined(L__stdlib_wcsto_ll_l) +#ifndef L__stdlib_strto_ll #define L__stdlib_strto_ll #endif +#endif #if defined(L__stdlib_strto_ll) || defined(L__stdlib_strto_ll_l) diff --git a/libc/stdlib/strtod.c b/libc/stdlib/strtod.c index f7625c5ae..9c76a2347 100644 --- a/libc/stdlib/strtod.c +++ b/libc/stdlib/strtod.c @@ -1,21 +1,9 @@ -/* Copyright (C) 2000, 2003 Manuel Novoa III +/* + * Copyright (C) 2000-2005 Manuel Novoa III * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ - /* Notes: * * The primary objective of this implementation was minimal size and @@ -201,7 +189,7 @@ extern void __fp_range_check(__fpmax_t y, __fpmax_t x); #define ISSPACE(C) iswspace((C)) #endif -#else /* defined(L___wcstofpmax) || defined(L___wcstofpmax) */ +#else /* defined(L___wcstofpmax) || defined(L___wcstofpmax_l) */ #define Wchar char #ifdef __UCLIBC_DO_XLOCALE @@ -210,7 +198,7 @@ extern void __fp_range_check(__fpmax_t y, __fpmax_t x); #define ISSPACE(C) isspace((C)) #endif -#endif /* defined(L___wcstofpmax) || defined(L___wcstofpmax) */ +#endif /* defined(L___wcstofpmax) || defined(L___wcstofpmax_l) */ #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) @@ -238,10 +226,10 @@ __fpmax_t __XL_NPP(__strtofpmax)(const Wchar *str, Wchar **endptr, int exponent_ int num_digits; #endif #ifdef __UCLIBC_HAS_LOCALE__ - const char *decpt = __LOCALE_PTR->decimal_point; -#if defined(L___wcstofpmax) || defined(L___wcstofpmax) +#if defined(L___wcstofpmax) || defined(L___wcstofpmax_l) wchar_t decpt_wc = __LOCALE_PTR->decimal_point; #else + const char *decpt = __LOCALE_PTR->decimal_point; int decpt_len = __LOCALE_PTR->decimal_point_len; #endif #endif @@ -320,7 +308,7 @@ __fpmax_t __XL_NPP(__strtofpmax)(const Wchar *str, Wchar **endptr, int exponent_ } #ifdef __UCLIBC_HAS_LOCALE__ -#if defined(L___wcstofpmax) || defined(L___wcstofpmax) +#if defined(L___wcstofpmax) || defined(L___wcstofpmax_l) if (!pos0 && (*pos == decpt_wc)) { /* First decimal point? */ pos0 = ++pos; goto LOOP; diff --git a/libc/string/arm/Makefile b/libc/string/arm/Makefile index a874eb96d..a7cbf6fa1 100644 --- a/libc/string/arm/Makefile +++ b/libc/string/arm/Makefile @@ -1,39 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -SSRC= _memcpy.S bcopy.S bzero.S memcmp.S memcpy.S memmove.S memset.S \ - strcmp.S strlen.S strncmp.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) -OBJS=$(SOBJS) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/frv/Makefile b/libc/string/frv/Makefile index 36682c94c..a7cbf6fa1 100644 --- a/libc/string/frv/Makefile +++ b/libc/string/frv/Makefile @@ -1,38 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2004 Alexandre Oliva <aoliva@redhat.com> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -SSRC=memcpy.S memset.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) -OBJS=$(SOBJS) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/i386/Makefile b/libc/string/i386/Makefile index d2baa7dd8..a7cbf6fa1 100644 --- a/libc/string/i386/Makefile +++ b/libc/string/i386/Makefile @@ -1,44 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -MSRC= string.c -MOBJ= strcpy.o strncpy.o strcat.o strncat.o strcmp.o \ - strncmp.o strchr.o strrchr.o strlen.o strnlen.o \ - memcpy.o memmove.o memchr.o memset.o -OBJS=$(MOBJ) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(MOBJ): $(MSRC) - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/powerpc/Makefile b/libc/string/powerpc/Makefile index c1b0ba184..a7cbf6fa1 100644 --- a/libc/string/powerpc/Makefile +++ b/libc/string/powerpc/Makefile @@ -1,42 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -MSRC= string.c -MOBJ= memcpy.o memmove.o memset.o bzero.o -OBJS=$(MOBJ) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(MOBJ): $(MSRC) - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/sh64/Makefile b/libc/string/sh64/Makefile index 0a7ee0ba2..a7cbf6fa1 100644 --- a/libc/string/sh64/Makefile +++ b/libc/string/sh64/Makefile @@ -1,38 +1,15 @@ -# Makefile for uClibc's sh64 optimized string routines +# Makefile for uClibc # -# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -SSRC= memcpy.S memset.S strcpy.S strlen.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) -OBJS=$(SOBJS) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/sparc/Makefile b/libc/string/sparc/Makefile index 2215a6025..a7cbf6fa1 100644 --- a/libc/string/sparc/Makefile +++ b/libc/string/sparc/Makefile @@ -2,30 +2,14 @@ # # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# Licensed under the GNU Library General Public License version 2 or later. -# See the COPYING.LIB file in the toplevel for more information. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -CSRCS = $(wildcard *.c) -COBJS = $(patsubst %.c,%.o,$(CSRCS)) - -SSRCS = $(wildcard *.S) -SOBJS = $(patsubst %.S,%.o,$(SSRCS)) - -OBJS = $(COBJS) $(SOBJS) - -OBJ_LIST = ../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/x86_64/Makefile b/libc/string/x86_64/Makefile index 2215a6025..a7cbf6fa1 100644 --- a/libc/string/x86_64/Makefile +++ b/libc/string/x86_64/Makefile @@ -2,30 +2,14 @@ # # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# Licensed under the GNU Library General Public License version 2 or later. -# See the COPYING.LIB file in the toplevel for more information. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -CSRCS = $(wildcard *.c) -COBJS = $(patsubst %.c,%.o,$(CSRCS)) - -SSRCS = $(wildcard *.S) -SOBJS = $(patsubst %.S,%.o,$(SSRCS)) - -OBJS = $(COBJS) $(SOBJS) - -OBJ_LIST = ../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/alpha/Makefile b/libc/sysdeps/linux/alpha/Makefile index cee893a3b..ed354d3dc 100644 --- a/libc/sysdeps/linux/alpha/Makefile +++ b/libc/sysdeps/linux/alpha/Makefile @@ -19,61 +19,50 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt1.S +CRT_OBJ := crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=__longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \ - setjmp.S divl.S reml.S remq.S divq.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \ + setjmp.S divl.S reml.S remq.S divq.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=sysdep.c #brk.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := sysdep.c #brk.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ $(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/arm/Makefile b/libc/sysdeps/linux/arm/Makefile index 19701e1d9..b1bf1ef10 100644 --- a/libc/sysdeps/linux/arm/Makefile +++ b/libc/sysdeps/linux/arm/Makefile @@ -1,88 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \ - bsd-_setjmp.S sigrestorer.S mmap64.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) - -CSRC=brk.c syscall.c ioperm.c iopl.c sigaction.c __syscall_error.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(SOBJS) $(COBJS) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SCRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif - -headers: - $(LN) -fs ../libc/sysdeps/linux/arm/fpu_control.h $(TOPDIR)/include/ -clean: - $(RM) *.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/bfin/Makefile b/libc/sysdeps/linux/bfin/Makefile index b43209106..85f3cb910 100644 --- a/libc/sysdeps/linux/bfin/Makefile +++ b/libc/sysdeps/linux/bfin/Makefile @@ -19,62 +19,35 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o -#CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -CTOR_TARGETS= +CRT_SRC := crt0.S +CRT_OBJ := crt0.o -SSRC= __longjmp.S setjmp.S bsd-_setjmp.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S setjmp.S bsd-_setjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=brk.c bsdsetjmp.c clone.c syscall.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := brk.c bsdsetjmp.c clone.c syscall.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) all: $(OBJ_LIST) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif headers: diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c index ab6a276bb..416ced4ea 100644 --- a/libc/sysdeps/linux/common/getdents.c +++ b/libc/sysdeps/linux/common/getdents.c @@ -26,7 +26,7 @@ #include <unistd.h> #include <sys/param.h> #include <sys/types.h> -#include <sysdep.h> +#include "sysdep.h" #include <sys/syscall.h> diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c index a37f5e514..1b4b0c368 100644 --- a/libc/sysdeps/linux/common/getdents64.c +++ b/libc/sysdeps/linux/common/getdents64.c @@ -25,7 +25,7 @@ #include <stdint.h> #include <string.h> #include <unistd.h> -#include <sysdep.h> +#include "sysdep.h" #include <sys/param.h> #include <sys/types.h> #include <sys/syscall.h> diff --git a/libc/sysdeps/linux/common/mmap64.c b/libc/sysdeps/linux/common/mmap64.c index eaf914432..969e1e227 100644 --- a/libc/sysdeps/linux/common/mmap64.c +++ b/libc/sysdeps/linux/common/mmap64.c @@ -22,7 +22,7 @@ #include <features.h> #include <errno.h> #include <unistd.h> -#include <sysdep.h> +#include "sysdep.h" #include <sys/mman.h> diff --git a/libc/sysdeps/linux/common/ssp.c b/libc/sysdeps/linux/common/ssp.c index 7791a0104..2f3a28ba4 100644 --- a/libc/sysdeps/linux/common/ssp.c +++ b/libc/sysdeps/linux/common/ssp.c @@ -87,6 +87,7 @@ void __attribute__ ((noreturn)) __stack_chk_fail(void) terminate(); } +#if 0 void __attribute__ ((noreturn)) __chk_fail(void) { extern char *__progname; @@ -101,3 +102,4 @@ void __attribute__ ((noreturn)) __chk_fail(void) while(1) terminate(); } +#endif diff --git a/libc/sysdeps/linux/cris/Makefile b/libc/sysdeps/linux/cris/Makefile index 9063ff7cf..3c60e01ca 100644 --- a/libc/sysdeps/linux/cris/Makefile +++ b/libc/sysdeps/linux/cris/Makefile @@ -19,63 +19,52 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.c -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.c +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC= setjmp.S __longjmp.S clone.S sysdep.S syscall.S +SSRC = setjmp.S __longjmp.S clone.S sysdep.S syscall.S ifeq ($(UNIFIED_SYSCALL),y) - SSRC += __uClibc_syscall.S +SSRC += __uClibc_syscall.S endif -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC= __init_brk.c brk.c sbrk.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := __init_brk.c brk.c sbrk.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/e1/Makefile b/libc/sysdeps/linux/e1/Makefile index e02888ac4..4e37d329f 100644 --- a/libc/sysdeps/linux/e1/Makefile +++ b/libc/sysdeps/linux/e1/Makefile @@ -24,61 +24,42 @@ UCLIBC_CTOR_DTOR=n # If you're looking for vfork(), it is defined in include/unistd.h +CRT_SRC := crt0.S +CRT_OBJ := crt0.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -CRT0=crt0.S -CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +# why is crt1.c listed in CSRC ? +CSRC := crt1.c syscalls.c longjmp.c setjmp.c vfork.c +OBJS := $(patsubst %.c,%.o, $(CSRC)) -SSRC= -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -CSRC=crt1.c syscalls.c longjmp.c setjmp.c vfork.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +all: $(OBJ_LIST) $(CTOR_TARGETS) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) $(CRT0_OBJ) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/$(CRT0_OBJ) - -$(CRT0_OBJ): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(SOBJS): %.o : %.S +$(CRT_OBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(OBJS): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/frv/Makefile b/libc/sysdeps/linux/frv/Makefile index bfb127af4..82d7ddf39 100644 --- a/libc/sysdeps/linux/frv/Makefile +++ b/libc/sysdeps/linux/frv/Makefile @@ -20,56 +20,51 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ)) -CRT0_DEPS=gmon-start.S +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +SCRT_OBJ := $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS = crti.o crtn.o +CTOR_TARGETS := crti.o crtn.o -SSRC=__longjmp.S setjmp.S clone.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S setjmp.S clone.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c -CSRC+=xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC = mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c +CSRC += xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) all: $(OBJ_LIST) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) crtreloc.o - $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $< crtreloc.o -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o +$(CRT_OBJ): $(CRT_SRC) crtreloc.o + $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $^ -o $*.o crtreloc.o: crtreloc.c $(CC) $(CFLAGS) -c $< -o $@ -$(SCRT0_OBJ): $(CRT0_SRC) Scrtreloc.o - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $< Scrtreloc.o -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o +$(SCRT_OBJ): $(CRT_SRC) Scrtreloc.o + $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $^ -o $*.o Scrtreloc.o: crtreloc.c $(CC) $(CFLAGS) $(PIEFLAG) -c $< -o $@ $(CTOR_TARGETS): %.o : %.S $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o headers: $(LN) -fs ../libc/sysdeps/linux/frv/link.h $(TOPDIR)/include/ diff --git a/libc/sysdeps/linux/h8300/Makefile b/libc/sysdeps/linux/h8300/Makefile index 5403feb01..ceb2c145e 100644 --- a/libc/sysdeps/linux/h8300/Makefile +++ b/libc/sysdeps/linux/h8300/Makefile @@ -19,66 +19,56 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak ifeq ($(DOPIC),y) +# is this not provided by gcc ? ASFLAGS+=-D__PIC__ endif #FIXME -- this arch should include its own crti.S and crtn.S UCLIBC_CTOR_DTOR=n -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=__longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=ptrace.c brk.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := ptrace.c brk.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile index e1795e0e5..b1bf1ef10 100644 --- a/libc/sysdeps/linux/i386/Makefile +++ b/libc/sysdeps/linux/i386/Makefile @@ -1,88 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \ - bsd-_setjmp.S syscall.S mmap.S mmap64.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) - -CSRC=brk.c sigaction.c __syscall_error.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(SOBJS) $(COBJS) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SCRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif - -headers: - $(LN) -fs ../libc/sysdeps/linux/i386/fpu_control.h $(TOPDIR)include/ -clean: - $(RM) *.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/i960/Makefile b/libc/sysdeps/linux/i960/Makefile index b4997b9db..7e6311280 100644 --- a/libc/sysdeps/linux/i960/Makefile +++ b/libc/sysdeps/linux/i960/Makefile @@ -22,60 +22,43 @@ include $(TOPDIR)Rules.mak #FIXME -- this arch should include its own crti.S and crtn.S UCLIBC_CTOR_DTOR=n -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=clone.S _mmap.S setjmp.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := clone.S _mmap.S setjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC= -COBJS=$(patsubst %.c,%.o, $(CSRC)) +OBJS := $(SOBJ) -OBJS=$(SOBJS) $(COBJS) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +all: $(OBJ_LIST) $(CTOR_TARGETS) -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/m68k/Makefile b/libc/sysdeps/linux/m68k/Makefile index 00ad88e6c..5173b2165 100644 --- a/libc/sysdeps/linux/m68k/Makefile +++ b/libc/sysdeps/linux/m68k/Makefile @@ -23,72 +23,60 @@ include $(TOPDIR)Rules.mak ifeq ($(ARCH_HAS_MMU),y) -CRT0_SRC = crt0.c +CRT_SRC := crt0.c else -CRT0_SRC = crt0.S +CRT_SRC := crt0.S endif -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC= __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=ptrace.c brk.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := ptrace.c brk.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) ifeq ($(ARCH_HAS_MMU),y) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o else $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o endif - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif - headers: -ifneq ($(strip $(HAVE_ELF)),y) +ifneq ($(HAVE_ELF),y) echo "Working around compiler bug in the m68k-pic-coff toolchain" $(LN) -fs ../libc/sysdeps/linux/m68k/float.h $(TOPDIR)/include/ endif @@ -96,6 +84,6 @@ endif clean: $(RM) *.o *~ core -ifneq ($(strip $(HAVE_ELF)),y) +ifneq ($(HAVE_ELF),y) $(RM) $(TOPDIR)/include/float.h endif diff --git a/libc/sysdeps/linux/microblaze/Makefile b/libc/sysdeps/linux/microblaze/Makefile index 01b91ef71..0c4baa9dc 100644 --- a/libc/sysdeps/linux/microblaze/Makefile +++ b/libc/sysdeps/linux/microblaze/Makefile @@ -23,65 +23,54 @@ include $(TOPDIR)Rules.mak #FIXME -- this arch should include its own crti.S and crtn.S UCLIBC_CTOR_DTOR=n -CFLAGS+=-I.. -ASFLAGS+=-I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl +CFLAGS += -I.. +ASFLAGS += -I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC = setjmp.S __longjmp.S vfork.S -SOBJS = $(patsubst %.S,%.o, $(SSRC)) +SSRC := setjmp.S __longjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC = mmap.c syscall.c clone.c -COBJS = $(patsubst %.c,%.o, $(CSRC)) +CSRC := mmap.c syscall.c clone.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS = $(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/nios/Makefile b/libc/sysdeps/linux/nios/Makefile index b2b622329..b1c558fee 100644 --- a/libc/sysdeps/linux/nios/Makefile +++ b/libc/sysdeps/linux/nios/Makefile @@ -19,61 +19,35 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS= +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o -SSRC= __longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC= brk.c crtbegin.c crtend.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := brk.c crtbegin.c crtend.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) all: $(OBJ_LIST) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif headers: $(LN) -fs ../libc/sysdeps/linux/nios/fpu_control.h $(TOPDIR)/include/ diff --git a/libc/sysdeps/linux/nios2/Makefile b/libc/sysdeps/linux/nios2/Makefile index 0292328f4..4202eb611 100644 --- a/libc/sysdeps/linux/nios2/Makefile +++ b/libc/sysdeps/linux/nios2/Makefile @@ -19,60 +19,49 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC= __longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S vfork.S clone.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S vfork.S clone.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC= brk.c syscall.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := brk.c syscall.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/powerpc/Makefile b/libc/sysdeps/linux/powerpc/Makefile index e0d5dcdd2..b1bf1ef10 100644 --- a/libc/sysdeps/linux/powerpc/Makefile +++ b/libc/sysdeps/linux/powerpc/Makefile @@ -1,89 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC=__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \ - clone.S __uClibc_syscall.S syscall.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) - -CSRC=mmap.c __syscall_error.c pread_write.c ioctl.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(SOBJS) $(COBJS) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SCRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif - -headers: - $(LN) -fs ../libc/sysdeps/linux/powerpc/fpu_control.h $(TOPDIR)/include/ -clean: - $(RM) *.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/sh/Makefile b/libc/sysdeps/linux/sh/Makefile index d986850ba..00ccb06af 100644 --- a/libc/sysdeps/linux/sh/Makefile +++ b/libc/sysdeps/linux/sh/Makefile @@ -20,65 +20,53 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt1.S +CRT_OBJ := crt1.o +SCRT_OBJ := Scrt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=setjmp.S __longjmp.S vfork.S clone.S ___fpscr_values.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := setjmp.S __longjmp.S vfork.S clone.S ___fpscr_values.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=mmap.c longjmp.c pipe.c __init_brk.c brk.c sbrk.c syscall.c pread_write.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := mmap.c longjmp.c pipe.c __init_brk.c brk.c sbrk.c syscall.c pread_write.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ $(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o $(SCRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/sh64/Makefile b/libc/sysdeps/linux/sh64/Makefile index af49f5f1c..94486deee 100644 --- a/libc/sysdeps/linux/sh64/Makefile +++ b/libc/sysdeps/linux/sh64/Makefile @@ -21,64 +21,53 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak CFLAGS += -I.. -ASFLAGS+=-I.. -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl +ASFLAGS += -I.. -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC = setjmp.S longjmp.S -SOBJS = $(patsubst %.S,%.o, $(SSRC)) +SSRC := setjmp.S longjmp.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC = __init_brk.c brk.c sbrk.c syscall.c -COBJS = $(patsubst %.c,%.o, $(CSRC)) +CSRC := __init_brk.c brk.c sbrk.c syscall.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS = $(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/sparc/Makefile b/libc/sysdeps/linux/sparc/Makefile index de2fe0a4e..579140f08 100644 --- a/libc/sysdeps/linux/sparc/Makefile +++ b/libc/sysdeps/linux/sparc/Makefile @@ -19,61 +19,53 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt1.S +CRT_OBJ := crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=__longjmp.S fork.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \ +SSRC := __longjmp.S fork.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \ urem.S udiv.S umul.S sdiv.S rem.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=brk.c __syscall_error.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := brk.c __syscall_error.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ $(CRT_OBJ): $(CRT_SRC) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ crtn.o: crtn.S $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/v850/Makefile b/libc/sysdeps/linux/v850/Makefile index d20bc89c6..2d54cc2e8 100644 --- a/libc/sysdeps/linux/v850/Makefile +++ b/libc/sysdeps/linux/v850/Makefile @@ -21,64 +21,53 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak CFLAGS += -I.. -ASFLAGS+=-I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl +ASFLAGS += -I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC = setjmp.S __longjmp.S vfork.S -SOBJS = $(patsubst %.S,%.o, $(SSRC)) +SSRC := setjmp.S __longjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC = mmap.c syscall.c clone.c -COBJS = $(patsubst %.c,%.o, $(CSRC)) +CSRC := mmap.c syscall.c clone.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS = $(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/x86_64/Makefile b/libc/sysdeps/linux/x86_64/Makefile index c38204e4d..b1bf1ef10 100644 --- a/libc/sysdeps/linux/x86_64/Makefile +++ b/libc/sysdeps/linux/x86_64/Makefile @@ -2,86 +2,14 @@ # # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC=__longjmp.S vfork.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S clone.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) - -CSRC=brk.c sigaction.c __syscall_error.c mmap.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(SOBJS) $(COBJS) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SCRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif - -headers: - $(LN) -fs ../libc/sysdeps/linux/x86_64/fpu_control.h $(TOPDIR)/include/ -clean: - $(RM) *.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules |