chiark / gitweb /
[PATCH] klibc: version 0.211
[elogind.git] / klibc / MCONFIG
1 # -*- makefile -*-
2 #
3 # Makefile configuration, without explicit rules
4 #
5
6 # CROSS is the prefix used for system tools like gcc, ld etc.
7 CROSS   = 
8
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.
12 KCROSS ?= $(CROSS)
13
14 # Location for installation
15 prefix      = /usr
16 bindir      = $(prefix)/bin
17 libdir      = $(prefix)/lib
18 mandir      = $(prefix)/man
19 INSTALLDIR  = $(prefix)/lib/klibc
20 INSTALLROOT =
21
22 INSTALL_EXEC = install -m 755
23 INSTALL_DATA = install -m 644
24
25 # Eventually support separate compilation, but we don't have it yet...
26 OBJROOT = $(SRCROOT)
27
28 # Kernel trees (source and obj) - can potentially be different
29 KRNLSRC = $(SRCROOT)/linux
30 KRNLOBJ = $(SRCROOT)/linux
31
32 ARCH    = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
33 CC      = $(CROSS)gcc
34 LD      = $(CROSS)ld
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__ \
42            $(INCLUDE)
43 LDFLAGS =
44 AR      = $(CROSS)ar
45 RANLIB  = $(CROSS)ranlib
46 NM      = $(CROSS)nm
47 PERL    = perl
48 OBJCOPY = $(CROSS)objcopy
49
50 STRIP      = $(CROSS)strip
51 STRIPFLAGS = --strip-all -R .comment -R .note
52 STRIPCMD   = $(STRIP) $(STRIPFLAGS)
53
54 HOST_CC      = gcc
55 HOST_CFLAGS  = -g -O
56 HOST_LDFLAGS = 
57 HOST_LIBS    =
58
59 # Static library paths
60 CRT0      = $(KLIBOBJ)/crt0.o
61 KLIBC     = $(KLIBOBJ)/libc.a
62 LIBGCC    = $(shell $(CC) --print-libgcc)
63
64 # Shared library paths
65 CRTSHARED = $(KLIBOBJ)/interp.o
66 LIBSHARED = $(KLIBOBJ)/libc.so
67
68 #
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.
72 #
73 SHLIBDIR = /lib
74
75 # Enable this to make perror/strerror return real error messages
76 # This makes klibc.so and any static binary which uses these functions
77 # about 4K bigger.
78 ERRLIST = 1
79
80 # Include zlib in klibc.  This roughly triples the size of klibc!
81 ZLIB = 0
82
83 #
84 # Include arch-specific rule fragments
85 #
86 include $(KLIBSRC)/arch/$(ARCH)/MCONFIG
87
88 ifeq ($(DEBUG),y)
89 STRIP     = /bin/true -Since_we_are_debugging
90 OPTFLAGS += -O1 -g
91 endif
92
93 # How to tell the linker main() is the entrypoint
94 EMAIN ?= -e main