Revision | 8eaff69d91445a494d8b1a387d5b96f1d669f74c (tree) |
---|---|
Time | 2001-01-16 20:25:23 |
Author | Eric Andersen <andersen@code...> |
Commiter | Eric Andersen |
Add first pass shared lib support into Makefile.
This could use some refinement...
@@ -31,13 +31,28 @@ include Rules.mak | ||
31 | 31 | |
32 | 32 | DIRS = misc pwd_grp stdio string termios unistd net signal stdlib sysdeps extra |
33 | 33 | |
34 | -all: libc.a | |
34 | +ifeq ($(HAS_MMU),true) | |
35 | + DO_SHARED=shared | |
36 | +endif | |
37 | + | |
38 | +all: libc.a $(DO_SHARED) done | |
35 | 39 | |
36 | 40 | libc.a: halfclean headers subdirs |
41 | + $(CROSS)ranlib libc.a | |
42 | + | |
43 | +# Surely there is a better way to do this then dumping all | |
44 | +# the objects into a tmp dir. Please -- someone enlighten me. | |
45 | +shared: libc.a | |
46 | + @rm -rf tmp | |
47 | + @mkdir tmp | |
48 | + @(cd tmp; ar -x ../libc.a) | |
49 | + $(CC) -s -nostdlib -shared -o libuClibc.so.1 -Wl,-soname,libuClibc.so.1 tmp/*.o | |
50 | + @rm -rf tmp | |
51 | + | |
52 | +done: libc.a $(DO_SHARED) | |
37 | 53 | @echo |
38 | 54 | @echo Finally finished compiling... |
39 | 55 | @echo |
40 | - $(CROSS)ranlib libc.a | |
41 | 56 | |
42 | 57 | halfclean: |
43 | 58 | @rm -f libc.a |
@@ -66,6 +81,7 @@ tags: | ||
66 | 81 | ctags -R |
67 | 82 | |
68 | 83 | clean: subdirs_clean |
84 | + @rm -rf tmp | |
69 | 85 | rm -f libc.a libcrt0.o |
70 | 86 | rm -f include/asm include/linux include/bits |
71 | 87 |