Makefile 1.4 KB

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