3 # Makefile configuration, without explicit rules
6 # CROSS is the prefix used for system tools like gcc, ld etc.
9 # KCROSS is the prefix we use for klibc installations. This is usually
10 # the same as CROSS, but may be different, e.g. to install an i386
11 # cross-compilation suite on an x86-64 system, using the same gcc/binutils.
14 # Location for installation
16 bindir = $(prefix)/bin
17 libdir = $(prefix)/lib
18 mandir = $(prefix)/man
19 INSTALLDIR = $(prefix)/lib/klibc
22 INSTALL_EXEC = install -m 755
23 INSTALL_DATA = install -m 644
25 # Eventually support separate compilation, but we don't have it yet...
28 # Kernel trees (source and obj) - can potentially be different
29 KRNLSRC = $(SRCROOT)/linux
30 KRNLOBJ = $(SRCROOT)/linux
32 ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
35 KLIBSRC = $(SRCROOT)/klibc
36 KLIBOBJ = $(OBJROOT)/klibc
37 INCLUDE = -I$(SRCROOT)/include/arch/$(ARCH) \
38 -I$(SRCROOT)/include/bits$(BITSIZE) \
39 -I$(SRCROOT)/include \
40 -I$(KRNLOBJ)/include -I$(KRNLOBJ)/include2 -I$(KRNLSRC)/include
41 REQFLAGS = $(ARCHREQFLAGS) -nostdinc -iwithprefix include -D__KLIBC__ \
45 RANLIB = $(CROSS)ranlib
48 OBJCOPY = $(CROSS)objcopy
51 STRIPFLAGS = --strip-all -R .comment -R .note
52 STRIPCMD = $(STRIP) $(STRIPFLAGS)
59 # Static library paths
60 CRT0 = $(KLIBOBJ)/crt0.o
61 KLIBC = $(KLIBOBJ)/libc.a
62 LIBGCC = $(shell $(CC) $(REQFLAGS) $(OPTFLAGS) --print-libgcc)
64 # Shared library paths
65 CRTSHARED = $(KLIBOBJ)/interp.o
66 LIBSHARED = $(KLIBOBJ)/libc.so
69 # This indicates the location of the final version of the shared library.
70 # THIS MUST BE AN ABSOLUTE PATH WITH NO FINAL SLASH.
71 # Leave this empty to make it the root.
75 # Enable this to make perror/strerror return real error messages
76 # This makes klibc.so and any static binary which uses these functions
80 # Include zlib in klibc. This roughly triples the size of klibc!
84 # Include arch-specific rule fragments
86 include $(KLIBSRC)/arch/$(ARCH)/MCONFIG
89 STRIP = /bin/true -Since_we_are_debugging
93 # How to tell the linker main() is the entrypoint