Browse Source

Patch from James Graves <jgraves@deltamobile.com> to get
m68k started. Should be just sysdeps/linux/m68k left to
hack at this point...

Eric Andersen 23 years ago
parent
commit
39d74aae95
6 changed files with 26 additions and 9 deletions
  1. 1 1
      Makefile
  2. 2 4
      Rules.mak
  3. 7 1
      libc/misc/Makefile
  4. 5 1
      libc/misc/internals/Makefile
  5. 6 0
      libc/misc/time/Makefile
  6. 5 2
      libc/stdlib/Makefile

+ 1 - 1
Makefile

@@ -28,7 +28,7 @@
 
 include Rules.mak
 
-DIRS = sysdeps misc pwd_grp stdio string termios unistd net signal stdlib
+DIRS = misc pwd_grp stdio string termios unistd net signal stdlib sysdeps
 
 all: libc.a
 

+ 2 - 4
Rules.mak

@@ -24,15 +24,13 @@
 
 include $(TOPDIR)Config
 
-GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
+GCCINCDIR = $(shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
 
 ARFLAGS=r
 
 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')
 
-ifeq ($(ARCH), arm)
+ifeq ($(TARGET_ARCH), arm)
     ARCH_CFLAGS=-fpic
 endif
 

+ 7 - 1
libc/misc/Makefile

@@ -25,7 +25,13 @@ include $(TOPDIR)Rules.mak
 LIBC=$(TOPDIR)libc.a
 
 
-DIRS = assert crypt ctype fnmatch glob internals lsearch mntent syslog regex shm time utmp
+DIRS = assert crypt ctype fnmatch glob internals lsearch mntent syslog shm time utmp
+
+# regex bombs out with an internal compiler error using m68k-pic-coff-gcc.
+ifneq ($(TARGET_ARCH),m68k)
+	DIRS += regex
+endif
+
 
 all: libc.a
 

+ 5 - 1
libc/misc/internals/Makefile

@@ -24,7 +24,11 @@ TOPDIR=../../
 include $(TOPDIR)Rules.mak
 LIBC=$(TOPDIR)libc.a
 
-CSRC=ultostr.c ltostr.c ulltostr.c lltostr.c zoicheck.c dtostr.c
+CSRC=ultostr.c ltostr.c ulltostr.c lltostr.c zoicheck.c
+ifeq ($(HAS_FLOATS),true)
+	CSRC += dtostr.c
+endif
+
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 

+ 6 - 0
libc/misc/time/Makefile

@@ -27,6 +27,12 @@ LIBC=$(TOPDIR)libc.a
 CSRC=localtime.c gmtime.c asctime.c ctime.c asc_conv.c tm_conv.c mktime.c \
 	localtime_r.c gmtime_r.c asctime_r.c ctime_r.c utimes.c adjtime.c \
 	strftime.c clock.c times.c difftime.c
+
+# strftime.c causes an internal compiler error with m68k-pic-coff-gcc.
+ifneq ($(TARGET_ARCH),m68k)
+	CSRC += strftime.c
+endif
+
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 

+ 5 - 2
libc/stdlib/Makefile

@@ -36,8 +36,11 @@ MSRC2=atexit.c
 MOBJ2=on_exit.o atexit.o __do_exit.o exit.o
 
 
-CSRC =	abort.c getenv.c  mktemp.c  qsort.c  realpath.c strtod.c \
-	abs.c   bsearch.c mkstemp.c putenv.c rand.c setenv.c  system.c
+CSRC =	abort.c getenv.c mktemp.c qsort.c realpath.c abs.c bsearch.c \
+	mkstemp.c putenv.c rand.c setenv.c system.c
+ifeq ($(HAS_FLOATS),true)
+	CSRC += strtod.c
+endif
 COBJS=$(patsubst %.c,%.o, $(CSRC))