summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-01-16 11:25:23 +0000
committerEric Andersen <andersen@codepoet.org>2001-01-16 11:25:23 +0000
commit8eaff69d91445a494d8b1a387d5b96f1d669f74c (patch)
tree49c3bc5a5377b3e6fa89a2f1bfe01fcad387959f /Makefile
parent5354f1ab0c1e6da8efd212e674c85c31e1d719e3 (diff)
Add first pass shared lib support into Makefile.
This could use some refinement...
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 18 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 23a7046d2..e1bacc09c 100644
--- a/Makefile
+++ b/Makefile
@@ -31,13 +31,28 @@ include Rules.mak
DIRS = misc pwd_grp stdio string termios unistd net signal stdlib sysdeps extra
-all: libc.a
+ifeq ($(HAS_MMU),true)
+ DO_SHARED=shared
+endif
+
+all: libc.a $(DO_SHARED) done
libc.a: halfclean headers subdirs
+ $(CROSS)ranlib libc.a
+
+# Surely there is a better way to do this then dumping all
+# the objects into a tmp dir. Please -- someone enlighten me.
+shared: libc.a
+ @rm -rf tmp
+ @mkdir tmp
+ @(cd tmp; ar -x ../libc.a)
+ $(CC) -s -nostdlib -shared -o libuClibc.so.1 -Wl,-soname,libuClibc.so.1 tmp/*.o
+ @rm -rf tmp
+
+done: libc.a $(DO_SHARED)
@echo
@echo Finally finished compiling...
@echo
- $(CROSS)ranlib libc.a
halfclean:
@rm -f libc.a
@@ -66,6 +81,7 @@ tags:
ctags -R
clean: subdirs_clean
+ @rm -rf tmp
rm -f libc.a libcrt0.o
rm -f include/asm include/linux include/bits