Annotation of dietlibc/Makefile, revision 1.16

1.1       cvs         1: all: start.o dietlibc.a elftrunc
                      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.9       fefe       10: VPATH=lib:libstdio:libugly:libcruft: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.1       cvs        40: #      $(CROSS)strip -x -R .comment -R .note $@
                     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)
                     47: 
                     48: libdietc.so: dietlibc.a
                     49:        $(CROSS)ld -whole-archive -shared -o $@ $^
                     50: 
                     51: $(SYSCALLOBJ): syscalls.h
                     52: 
                     53: elftrunc: contrib/elftrunc.c start.o dietlibc.a
1.16    ! fefe       54:        $(CROSS)$(CC) -Iinclude $(CFLAGS) -nostdlib -o $@ $^
1.1       cvs        55: 
                     56: djb: compile load
                     57: 
                     58: compile:
1.14      fefe       59:        echo 'exec gcc $(CFLAGS) -I$(PWD)/include -c $${1+"$$@"}' > $@
1.1       cvs        60:        chmod 755 $@
                     61: 
                     62: load:
1.14      fefe       63:        echo 'main="$$1"; shift; exec gcc -nostdlib -o "$$main" $(PWD)/start.o "$$main".o $${1+"$$@"} $(PWD)/dietlibc.a -lgcc'  > $@
1.1       cvs        64:        chmod 755 $@
                     65: 
                     66: clean:
                     67:        rm -f *.o *.a t t1 compile load elftrunc exports mapfile libdietc.so
                     68:        $(MAKE) -C examples clean
                     69: 
                     70: tar: clean
1.11      fefe       71:        rm -f armv4l
1.3       fefe       72:        ln -sf arm armv4l
1.8       fefe       73:        cd ..; tar cvvf dietlibc.tar.bz2 dietlibc --use=bzip2 --exclude CVS
1.1       cvs        74: 
                     75: exports: dietlibc.a
                     76:        nm -g dietlibc.a | grep -w T | awk '{ print $$3 }' | sort -u > exports
                     77: 
                     78: .PHONY: t t1
                     79: t:
1.16    ! fefe       80:        $(CROSS)$(CC) -g $(CFLAGS) -fno-builtin -nostdlib -Iinclude -o t t.c start.o dietlibc.a -lgcc -Wl,-Map,mapfile
1.1       cvs        81: 
                     82: t1:
1.16    ! fefe       83:        $(CROSS)$(CC) -g -o t1 t.c
1.1       cvs        84: 
                     85: install:
1.10      fefe       86:        cp start.o $(INSTALLPREFIX)$(prefix)/lib/dietstart.o
                     87:        cp dietlibc.a $(INSTALLPREFIX)$(prefix)/lib/libdietc.a
1.1       cvs        88: 
                     89: .PHONY: sparc ppc mips arm alpha i386
                     90: 
                     91: sparc ppc alpha i386:
                     92:        $(MAKE) ARCH=$@ CROSS=$@-linux- all t libdietc.so
                     93: 
                     94: mips arm:
                     95:        $(MAKE) ARCH=$@ CROSS=$@-linux-gnu- all t libdietc.so
                     96: 
1.15      fefe       97: 
                     98: 
                     99: # these depend on dietfeatures.h for large file backward compatibility
                    100: __fstat64.o __lstat64.o __stat64.o: dietfeatures.h
                    101: 
                    102: # these depend on dietfeatures.h for thread support
                    103: alloc.o perror.o: dietfeatures.h
                    104: 
                    105: # these depend on dietfeatures.h for linker warnings
                    106: assert_fail.o sprintf.o vsnprintf.o ___div.o fflush.o setvbuf.o system.o sendfile.o: dietfeatures.h
                    107: 
                    108: # these depend on dietfeatures.h for buffered stdio
                    109: fclose.o fdglue.o fflush.o fgetc.o fputc.o fread.o fseek.o: dietfeatures.h
                    110: printf.o setvbuf.o stderr.o stdin.o stdout.o fwrite.o: dietfeatures.h
                    111: 
                    112: # these depend on dietfeatures.h for fast string routines
                    113: strcasecmp.o strcat.o strchr.o strcmp.o strcpy.o strlen.o: dietfeatures.h
                    114: strncasecmp.o strncat.o strrchr.o: dietfeatures.h
                    115: 
                    116: # these depend on dietfeatures.h for /proc
                    117: tty.o: dietfeatures.h
                    118: 
                    119: # these depend on dietfeatures.h for ungetc support ;-)
                    120: ungetc.o: dietfeatures.h
                    121: 

LinuxTV legacy CVS <linuxtv.org/cvs>