chiark / gitweb /
switch tools and volume_id from LGPL to GPLv2
[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 # klibc version information
33 KLIBCVER = -D__KLIBC__=$(shell cut -d. -f1 < $(SRCROOT)/version) \
34            -D__KLIBC_MINOR__=$(shell cut -d. -f2 < $(SRCROOT)/version)
35
36 ARCH    = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/parisc.*/parisc/)
37 CC      = $(CROSS)gcc
38 LD      = $(CROSS)ld
39 KLIBSRC = $(SRCROOT)/klibc
40 KLIBOBJ = $(OBJROOT)/klibc
41 INCLUDE = -I$(SRCROOT)/include/arch/$(ARCH) \
42           -I$(SRCROOT)/include/bits$(BITSIZE) \
43           -I$(SRCROOT)/include \
44           -I$(KRNLOBJ)/include -I$(KRNLOBJ)/include2 -I$(KRNLSRC)/include
45 REQFLAGS = $(ARCHREQFLAGS) $(KLIBCVER) -nostdlib -nostdinc -iwithprefix include \
46            $(INCLUDE)
47 LDFLAGS =
48 AR      = $(CROSS)ar
49 RANLIB  = $(CROSS)ranlib
50 NM      = $(CROSS)nm
51 PERL    = perl
52 OBJCOPY = $(CROSS)objcopy
53
54 STRIP      = $(CROSS)strip
55 STRIPFLAGS = --strip-all -R .comment -R .note
56 STRIPCMD   = $(STRIP) $(STRIPFLAGS)
57
58 HOST_CC      = gcc
59 HOST_CFLAGS  = -g -O
60 HOST_LDFLAGS = 
61 HOST_LIBS    =
62
63 # Static library paths
64 CRT0      = $(KLIBOBJ)/crt0.o
65 KLIBC     = $(KLIBOBJ)/libc.a
66 LIBGCC    = $(shell $(CC) $(REQFLAGS) $(OPTFLAGS) --print-libgcc)
67
68 # Shared library paths
69 CRTSHARED = $(KLIBOBJ)/interp.o
70 LIBSHARED = $(KLIBOBJ)/libc.so
71
72 #
73 # This indicates the location of the final version of the shared library.
74 # THIS MUST BE AN ABSOLUTE PATH WITH NO FINAL SLASH.
75 # Leave this empty to make it the root.
76 #
77 SHLIBDIR = /lib
78
79 # Enable this to make perror/strerror return real error messages
80 # This makes klibc.so and any static binary which uses these functions
81 # about 4K bigger.
82 ERRLIST = 1
83
84 # Include zlib in klibc.  This roughly triples the size of klibc!
85 ZLIB = 0
86
87 #
88 # Include arch-specific rule fragments
89 #
90 include $(KLIBSRC)/arch/$(ARCH)/MCONFIG
91
92 ifeq ($(DEBUG),y)
93 STRIP     = /bin/true -Since_we_are_debugging
94 OPTFLAGS += -O1 -g
95 endif
96
97 # How to tell the linker main() is the entrypoint
98 EMAIN ?= -e main