3 # Makefile configuration, without explicit rules
6 # Location for installation
10 mandir = $(prefix)/man
11 INSTALLDIR = $(prefix)/lib/klibc
14 INSTALL_EXEC = install -m 755
15 INSTALL_DATA = install -m 644
17 # Eventually support separate compilation, but we don't have it yet...
20 # Kernel trees (source and obj) - can potentially be different
21 KRNLSRC = $(SRCROOT)/linux
22 KRNLOBJ = $(SRCROOT)/linux
24 ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
28 KLIBSRC = $(SRCROOT)/klibc
29 KLIBOBJ = $(OBJROOT)/klibc
30 INCLUDE = -I$(SRCROOT)/include/arch/$(ARCH) \
31 -I$(SRCROOT)/include/bits$(BITSIZE) \
32 -I$(SRCROOT)/include \
33 -I$(KRNLOBJ)/include -I$(KRNLOBJ)/include2 -I$(KRNLSRC)/include
34 REQFLAGS = $(ARCHREQFLAGS) -nostdinc -iwithprefix include -D__KLIBC__ \
38 RANLIB = $(CROSS)ranlib
41 OBJCOPY = $(CROSS)objcopy
44 STRIPFLAGS = --strip-all -R .comment -R .note
45 STRIPCMD = $(STRIP) $(STRIPFLAGS)
52 # Static library paths
53 CRT0 = $(KLIBOBJ)/crt0.o
54 KLIBC = $(KLIBOBJ)/libc.a
55 LIBGCC = $(shell $(CC) --print-libgcc)
57 # Shared library paths
58 CRTSHARED = $(KLIBOBJ)/interp.o
59 LIBSHARED = $(KLIBOBJ)/libc.so
62 # This indicates the location of the final version of the shared library.
63 # THIS MUST BE AN ABSOLUTE PATH WITH NO FINAL SLASH.
64 # Leave this empty to make it the root.
68 # Enable this to make perror/strerror return real error messages
69 # This makes klibc.so and any static binary which uses these functions
73 # Include zlib in klibc. This roughly triples the size of klibc!
77 # Include arch-specific rule fragments
79 include $(KLIBSRC)/arch/$(ARCH)/MCONFIG
82 STRIP = /bin/true -Since_we_are_debugging
86 # How to tell the linker main() is the entrypoint