Annotation of dietlibc/Makefile, revision 1.21
1.17 fefe 1: all: start.o dietlibc.a liblatin1.a elftrunc
1.1 cvs 2:
3: ARCH=$(shell uname -m | sed 's/i[4-9]86/i386/')
4:
5: CFLAGS=-pipe
6: CROSS=
7:
1.16 fefe 8: CC=gcc
9:
1.21 ! fefe 10: VPATH=lib:libstdio:libugly:libcruft:libcrypt:liblatin1:syscalls.c
1.1 cvs 11:
12: SYSCALLOBJ=$(patsubst syscalls.s/%.S,%.o,$(wildcard syscalls.s/*.S))
13:
14: LIBOBJ=$(patsubst lib/%.c,%.o,$(wildcard lib/*.c))
1.5 fefe 15: LIBUGLYOBJ=$(patsubst libugly/%.c,%.o,$(wildcard libugly/*.c))
16: LIBSTDIOOBJ=$(patsubst libstdio/%.c,%.o,$(wildcard libstdio/*.c))
1.9 fefe 17: LIBCRUFTOBJ=$(patsubst libcruft/%.c,%.o,$(wildcard libcruft/*.c))
1.20 olaf 18: LIBCRYPTOBJ=$(patsubst libcrypt/%.c,%.o,$(wildcard libcrypt/*.c))
1.1 cvs 19:
20: include $(ARCH)/Makefile.add
21:
22: ifeq ($(CFLAGS),-pipe)
23: CFLAGS+=-O -fomit-frame-pointer
24: endif
25:
1.13 fefe 26: #CFLAGS = -g
1.1 cvs 27: CFLAGS += -Wall
28:
1.14 fefe 29: PWD=$(shell pwd)
30:
1.1 cvs 31: .SUFFIXES:
32: .SUFFIXES: .S .c
33:
1.2 olaf 34: % :: %,v
1.1 cvs 35:
36: %.o: %.S
1.16 fefe 37: $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $<
1.1 cvs 38:
39: %.o: %.c
1.16 fefe 40: $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $<
1.18 fefe 41: # $(CROSS)strip -x -R .comment -R .note $@
1.1 cvs 42:
1.5 fefe 43: DIETLIBC_OBJ = $(SYSCALLOBJ) $(LIBOBJ) $(LIBSTDIOOBJ) $(LIBUGLYOBJ) \
1.20 olaf 44: $(LIBCRUFTOBJ) $(LIBCRYPTOBJ) __longjmp.o setjmp.o unified.o mmap.o clone.o
1.1 cvs 45:
46: dietlibc.a: $(DIETLIBC_OBJ) start.o
47: $(CROSS)ar cru dietlibc.a $(DIETLIBC_OBJ)
1.17 fefe 48:
49: LIBLATIN1_OBJS=$(patsubst liblatin1/%.c,%.o,$(wildcard liblatin1/*.c))
50: liblatin1.a: $(LIBLATIN1_OBJS)
51: $(CROSS)ar cru $@ $^
1.1 cvs 52:
53: libdietc.so: dietlibc.a
54: $(CROSS)ld -whole-archive -shared -o $@ $^
55:
56: $(SYSCALLOBJ): syscalls.h
57:
58: elftrunc: contrib/elftrunc.c start.o dietlibc.a
1.16 fefe 59: $(CROSS)$(CC) -Iinclude $(CFLAGS) -nostdlib -o $@ $^
1.1 cvs 60:
61: djb: compile load
62:
63: compile:
1.14 fefe 64: echo 'exec gcc $(CFLAGS) -I$(PWD)/include -c $${1+"$$@"}' > $@
1.1 cvs 65: chmod 755 $@
66:
67: load:
1.14 fefe 68: echo 'main="$$1"; shift; exec gcc -nostdlib -o "$$main" $(PWD)/start.o "$$main".o $${1+"$$@"} $(PWD)/dietlibc.a -lgcc' > $@
1.1 cvs 69: chmod 755 $@
70:
71: clean:
72: rm -f *.o *.a t t1 compile load elftrunc exports mapfile libdietc.so
73: $(MAKE) -C examples clean
74:
75: tar: clean
1.11 fefe 76: rm -f armv4l
1.3 fefe 77: ln -sf arm armv4l
1.8 fefe 78: cd ..; tar cvvf dietlibc.tar.bz2 dietlibc --use=bzip2 --exclude CVS
1.1 cvs 79:
80: exports: dietlibc.a
81: nm -g dietlibc.a | grep -w T | awk '{ print $$3 }' | sort -u > exports
82:
83: .PHONY: t t1
84: t:
1.16 fefe 85: $(CROSS)$(CC) -g $(CFLAGS) -fno-builtin -nostdlib -Iinclude -o t t.c start.o dietlibc.a -lgcc -Wl,-Map,mapfile
1.1 cvs 86:
87: t1:
1.16 fefe 88: $(CROSS)$(CC) -g -o t1 t.c
1.1 cvs 89:
90: install:
1.10 fefe 91: cp start.o $(INSTALLPREFIX)$(prefix)/lib/dietstart.o
92: cp dietlibc.a $(INSTALLPREFIX)$(prefix)/lib/libdietc.a
1.1 cvs 93:
94: .PHONY: sparc ppc mips arm alpha i386
95:
1.19 fefe 96: arm sparc ppc alpha i386:
1.1 cvs 97: $(MAKE) ARCH=$@ CROSS=$@-linux- all t libdietc.so
98:
1.19 fefe 99: mips:
1.1 cvs 100: $(MAKE) ARCH=$@ CROSS=$@-linux-gnu- all t libdietc.so
101:
1.15 fefe 102:
103:
104: # these depend on dietfeatures.h for large file backward compatibility
105: __fstat64.o __lstat64.o __stat64.o: dietfeatures.h
106:
107: # these depend on dietfeatures.h for thread support
108: alloc.o perror.o: dietfeatures.h
109:
110: # these depend on dietfeatures.h for linker warnings
111: assert_fail.o sprintf.o vsnprintf.o ___div.o fflush.o setvbuf.o system.o sendfile.o: dietfeatures.h
112:
113: # these depend on dietfeatures.h for buffered stdio
114: fclose.o fdglue.o fflush.o fgetc.o fputc.o fread.o fseek.o: dietfeatures.h
115: printf.o setvbuf.o stderr.o stdin.o stdout.o fwrite.o: dietfeatures.h
116:
117: # these depend on dietfeatures.h for fast string routines
118: strcasecmp.o strcat.o strchr.o strcmp.o strcpy.o strlen.o: dietfeatures.h
119: strncasecmp.o strncat.o strrchr.o: dietfeatures.h
120:
121: # these depend on dietfeatures.h for /proc
122: tty.o: dietfeatures.h
123:
124: # these depend on dietfeatures.h for ungetc support ;-)
125: ungetc.o: dietfeatures.h
126:
1.18 fefe 127: # these depend on dietfeatures.h for WANT_TZFILE_PARSER
128: localtime_r.o: dietfeatures.h
LinuxTV legacy CVS <linuxtv.org/cvs>