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