OSDN Git Service

Fix up default .so number. This should avoid conflicts with libc5
[uclinux-h8/uClibc.git] / Rules.mak
index f081aff..8131154 100644 (file)
--- a/Rules.mak
+++ b/Rules.mak
@@ -2,10 +2,10 @@
 #
 # This file contains rules which are shared between multiple Makefiles.  All
 # normal configuration options live in the file named "Config".  You probably
-# should not mess with this file unless you know what you are doing...  -Erik
-# Andersen <andersen@lineo.com> < andersee@debian.org>
+# should not mess with this file unless you know what you are doing...  
+#   -Erik Andersen <andersen@lineo.com> < andersee@debian.org>
 # 
-# Copyright (C) 2000 by Lineo, inc.
+# Copyright (C) 2000, 2001 by Lineo, inc.
 #
 # 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
 
 include $(TOPDIR)Config
 
-GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
+MAJOR_VERSION=0
+MINOR_VERSION=95
 
-ARFLAGS=r
+LIBNAME=libc.a
+SHARED_FULLNAME=uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so
+SHARED_MAJORNAME=libc.so.$(MAJOR_VERSION)
+
+BUILDTIME = $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z")
 
-CCFLAGS=$(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) -Dlinux -D__linux__ -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D__LIBC__
-# Figure out what arch to build...
-ARCH = $(shell uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/' -e 's/arm.*/arm/g')
+GCCINCDIR = $(shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
 
-ifeq ($(ARCH), arm)
-    ARCH_CFLAGS=-fpic
+# use '-Os' optimization if available, else use -O2, allow Config to override
+ifndef OPTIMIZATION
+OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
+    then echo "-Os"; else echo "-O2" ; fi)
 endif
 
-CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS)
+ARFLAGS=r
+
+CCFLAGS=$(WARNINGS) $(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D_LIBC
 
-ifeq ($(DODEBUG),true)
-    CFLAGS += $(WARNINGS) -g
+CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS) $(ARCH_CFLAGS2)
+
+ifeq ($(strip $(DODEBUG)),true)
+    CFLAGS += -g
     LDFLAGS = -nostdlib -Wl,-warn-common 
     STRIPTOOL = /bin/true -Since_we_are_debugging
 else
-    CFLAGS  += $(WARNINGS) #-fomit-frame-pointer
+    CFLAGS  += -DNDEBUG #-fomit-frame-pointer
     LDFLAGS  = -s -nostdlib -Wl,-warn-common
 endif
 
@@ -51,26 +60,18 @@ ifndef $(PREFIX)
     PREFIX = `pwd`/_install
 endif
 
-ifneq ($(HAS_MMU),true)
-    CFLAGS += -D__HAS_NO_MMU__
-    ARCH_DIR = $(shell echo $(TARGET_ARCH)nommu)
-else
-    ARCH_DIR = $(TARGET_ARCH)
-endif
-
-ifneq ($(HAS_FLOATS),true)
-    CFLAGS += -D__HAS_NO_FLOATS__
-endif
-
-
+NATIVE_ARCH = $(shell uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/' -e 's/arm.*/arm/g' -e 's/m68k.*/m68k/')
 
+# It turns out the currently, function-sections causes ldelf2flt to segfault.
+# So till further notice, this is disabled by default....
+# 
 # Use '-ffunction-sections -fdata-sections' and '--gc-sections' if they work
 # to try and strip out any unused junk automagically....
 #
-ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
-       -o /dev/null -xc /dev/null && $(LD) --gc-sections -v >/dev/null && echo 1),1)
-    CFLAGS += -ffunction-sections -fdata-sections
-    LDFLAGS += --gc-sections
-endif
+#ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
+#      -o /dev/null -xc /dev/null && $(LD) --gc-sections -v >/dev/null && echo 1),1)
+#    CFLAGS += -ffunction-sections -fdata-sections
+#    LDFLAGS += --gc-sections
+#endif