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