# Makefile configuration, without explicit rules
#
+# CROSS is the prefix used for system tools like gcc, ld etc.
+CROSS =
+
+# KCROSS is the prefix we use for klibc installations. This is usually
+# the same as CROSS, but may be different, e.g. to install an i386
+# cross-compilation suite on an x86-64 system, using the same gcc/binutils.
+KCROSS ?= $(CROSS)
+
+# Location for installation
+prefix = /usr
+bindir = $(prefix)/bin
+libdir = $(prefix)/lib
+mandir = $(prefix)/man
+INSTALLDIR = $(prefix)/lib/klibc
+INSTALLROOT =
+
+INSTALL_EXEC = install -m 755
+INSTALL_DATA = install -m 644
+
# Eventually support separate compilation, but we don't have it yet...
OBJROOT = $(SRCROOT)
KRNLOBJ = $(SRCROOT)/linux
ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
-CROSS =
CC = $(CROSS)gcc
LD = $(CROSS)ld
KLIBSRC = $(SRCROOT)/klibc
-I$(SRCROOT)/include/bits$(BITSIZE) \
-I$(SRCROOT)/include \
-I$(KRNLOBJ)/include -I$(KRNLOBJ)/include2 -I$(KRNLSRC)/include
-REQFLAGS = $(ARCHREQFLAGS) -nostdinc -iwithprefix include \
- -D__KLIBC__ -DBITSIZE=$(BITSIZE) \
- $(INCLUDE)
+REQFLAGS = $(ARCHREQFLAGS) -nostdinc -iwithprefix include -D__KLIBC__ \
+ $(INCLUDE)
LDFLAGS =
AR = $(CROSS)ar
RANLIB = $(CROSS)ranlib
NM = $(CROSS)nm
PERL = perl
-STRIP = $(CROSS)strip --strip-all -R .comment -R .note
OBJCOPY = $(CROSS)objcopy
+STRIP = $(CROSS)strip
+STRIPFLAGS = --strip-all -R .comment -R .note
+STRIPCMD = $(STRIP) $(STRIPFLAGS)
+
HOST_CC = gcc
HOST_CFLAGS = -g -O
HOST_LDFLAGS =
# about 4K bigger.
ERRLIST = 1
+# Include zlib in klibc. This roughly triples the size of klibc!
+ZLIB = 0
+
#
# Include arch-specific rule fragments
#