home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / elf / d-link / libdl / Makefile < prev   
Encoding:
Makefile  |  1994-11-05  |  1.5 KB  |  63 lines

  1. TOPDIR=../../..
  2.  
  3. include $(TOPDIR)/Makeconfig
  4. include $(TOPDIR)/Makerules
  5.  
  6. INC_CFLAGS=-I.. -I../$(TARGET_ARCH) -DNO_UNDERSCORE -DVERBOSE_DLINKER
  7.  
  8. PIC_OPT_CFLAGS=-fPIC -O2 -D__PIC__  # -funroll-loops
  9.  
  10. SRC2S = dlib.c
  11.  
  12. SRCS    = $(SRC1S) $(SRC2S)
  13. OBJ1S    = $(SRC1S:.S=.o)
  14. OBJ2S    = $(SRC2S:.c=.o)
  15. OBJS    = $(OBJ1S) $(OBJ2S)
  16.  
  17. DL_VERSION:=$(shell awk -F= ' { if ($$1 == "Version")  print $$2 }' \
  18.   ../../libdl/jump.params)
  19.  
  20. DL_MAJOR:=$(shell awk -F= ' { \
  21.   if ($$1 == "Version") { \
  22.     for (i = 1; i <= length ($$2); i++) { \
  23.       if (substr ($$2, i, 1) == ".") { \
  24.     print substr ($$2, 1, i - 1); break; \
  25.       } } } } '  ../../libdl/jump.params)
  26.  
  27. LIBDL=$(ELF_SHARED_DIR)/libdl.so.$(DL_VERSION)
  28.  
  29. ELF_LDFLAGS=--shared -nostdlib # using GNU ld
  30. #ELF_LDFLAGS=-G  # with SVr4 ld
  31.  
  32. lib:: $(OBJS)
  33.     $(CC) $(ELF_LDFLAGS) -o $(LIBDL) -Wl,-soname -Wl,libdl.so.$(DL_MAJOR) *.o
  34.  
  35. obj: $(OBJS)
  36.  
  37. realclean::
  38.     $(RM) -f .depend core *.o *.a *.s *.i tmp_make foo
  39.  
  40. clean::
  41.     $(RM) -f core *.o *.a *.s *.i tmp_make foo
  42.  
  43. depend::
  44.     $(CC) $(CFLAGS) -M $(SRCS) | \
  45.         sed -e 's,^[     ]*\(.*.o\)[     ]*:,$(STATIC_DIR)/$(SUBDIR)/\1 $(SHARED_DIR)/$(SUBDIR)/\1 $(SHARED_LITE_DIR)/$(SUBDIR)/\1 $(DEBUG_DIR)/$(SUBDIR)/\1 $(PROFILE_DIR)/$(SUBDIR)/\1 $(CHECKER_DIR)/$(SUBDIR)/\1:,' > .depend
  46. #    $(MAKE) subdir TARGET=depend
  47.  
  48. ifneq ($(DIRS),)
  49. lib realclean clean depend::
  50.     @for i in $(DIRS); do \
  51.       echo making $@ in $$i; \
  52.       ($(MAKE) -C $$i $@); \
  53.     done;
  54. endif
  55.  
  56. #
  57. # include a dependency file if one exists
  58. #
  59. ifeq (.depend,$(wildcard .depend))
  60. include .depend
  61. endif
  62.  
  63.