summaryrefslogtreecommitdiff
path: root/librt/Makefile
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-01-11 09:41:40 +0000
committerEric Andersen <andersen@codepoet.org>2005-01-11 09:41:40 +0000
commit50a6ac7fb90ad4008b354ff8e72c6ce511dbeb3a (patch)
treebbfa2262a83889c6aeed9e9017df8517536e3b4a /librt/Makefile
parent45a95a466117aee2cd60f97be8310b6a04197244 (diff)
Patch from Paul Mundt (lethal) adding an initial librt implementation.
I then reworked the syscall handling and made minor cleanups. With luck I've not completely broken his patch...
Diffstat (limited to 'librt/Makefile')
-rw-r--r--librt/Makefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/librt/Makefile b/librt/Makefile
new file mode 100644
index 000000000..b84520af3
--- /dev/null
+++ b/librt/Makefile
@@ -0,0 +1,47 @@
+#
+# Makefile for librt
+#
+
+TOPDIR=../
+include $(TOPDIR)Rules.mak
+LIBC=$(TOPDIR)libc.a
+
+LIBRT=librt.a
+LIBRT_SHARED=librt.so
+LIBRT_SHARED_FULLNAME=librt-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
+
+# uClibc's librt lacks all aio routines, all clock routines,
+# and all shm routines
+CSRC=mq_open.c mq_close.c mq_unlink.c mq_getsetattr.c \
+ mq_send.c mq_receive.c mq_notify.c \
+ timer_create.c timer_delete.c \
+ timer_settime.c timer_gettime.c timer_getoverr.c
+OBJS=$(patsubst %.c,%.o, $(CSRC))
+
+all: $(OBJS) $(LIBC)
+
+$(LIBC): ar-target
+
+ar-target: $(OBJS)
+ $(AR) $(ARFLAGS) $(LIBRT) $(OBJS)
+ $(INSTALL) -d $(TOPDIR)lib
+ $(RM) $(TOPDIR)lib/$(LIBRT)
+ $(INSTALL) -m 644 $(LIBRT) $(TOPDIR)lib/
+
+$(OBJS): %.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
+shared: all
+ $(LD) $(LDFLAGS) -soname=$(LIBRT_SHARED).$(MAJOR_VERSION) \
+ -o $(LIBRT_SHARED_FULLNAME) --whole-archive $(LIBRT) \
+ --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \
+ -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC);
+ $(INSTALL) -d $(TOPDIR)lib
+ $(RM) $(TOPDIR)lib/$(LIBRT_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBRT_SHARED).$(MAJOR_VERSION)
+ $(INSTALL) -m 644 $(LIBRT_SHARED_FULLNAME) $(TOPDIR)lib
+ $(LN) -sf $(LIBRT_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBRT_SHARED)
+ $(LN) -sf $(LIBRT_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBRT_SHARED).$(MAJOR_VERSION)
+
+clean:
+ $(RM) *.[oa] *~ core $(LIBRT_SHARED)* $(LIBRT_SHARED_FULLNAME)*