Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #
  2. # Makefile for librt
  3. #
  4. TOPDIR=../
  5. include $(TOPDIR)Rules.mak
  6. LIBC=$(TOPDIR)libc.a
  7. LIBRT=librt.a
  8. LIBRT_SHARED=librt.so
  9. LIBRT_SHARED_FULLNAME=librt-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
  10. # uClibc's librt lacks all aio routines, all clock routines,
  11. # and all shm routines
  12. CSRC=mq_open.c mq_close.c mq_unlink.c mq_getsetattr.c \
  13. mq_send.c mq_receive.c mq_notify.c \
  14. timer_create.c timer_delete.c \
  15. timer_settime.c timer_gettime.c timer_getoverr.c
  16. OBJS=$(patsubst %.c,%.o, $(CSRC))
  17. all: $(OBJS) $(LIBC)
  18. $(LIBC): ar-target
  19. ar-target: $(OBJS)
  20. $(AR) $(ARFLAGS) $(LIBRT) $(OBJS)
  21. $(INSTALL) -d $(TOPDIR)lib
  22. $(RM) $(TOPDIR)lib/$(LIBRT)
  23. $(INSTALL) -m 644 $(LIBRT) $(TOPDIR)lib/
  24. $(OBJS): %.o : %.c
  25. $(CC) $(CFLAGS) -c $< -o $@
  26. $(STRIPTOOL) -x -R .note -R .comment $*.o
  27. shared: all
  28. $(LD) $(LDFLAGS) -soname=$(LIBRT_SHARED).$(MAJOR_VERSION) \
  29. -o $(LIBRT_SHARED_FULLNAME) --whole-archive $(LIBRT) \
  30. --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \
  31. -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC);
  32. $(INSTALL) -d $(TOPDIR)lib
  33. $(RM) $(TOPDIR)lib/$(LIBRT_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBRT_SHARED).$(MAJOR_VERSION)
  34. $(INSTALL) -m 644 $(LIBRT_SHARED_FULLNAME) $(TOPDIR)lib
  35. $(LN) -sf $(LIBRT_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBRT_SHARED)
  36. $(LN) -sf $(LIBRT_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBRT_SHARED).$(MAJOR_VERSION)
  37. clean:
  38. $(RM) *.[oa] *~ core $(LIBRT_SHARED)* $(LIBRT_SHARED_FULLNAME)*