123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- # Makefile for uClibc
- #
- # Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
- #
- # Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
- #
- #LIB_NAME:=libsome
- ifneq ($(strip $(LIB_NAME)),)
- ifeq ($(strip $(srcdir)),)
- srcdir=$(top_srcdir)$(LIB_NAME)
- endif
- ifeq ($(strip $($(LIB_NAME)_DIR)),)
- $(LIB_NAME)_DIR:=$(top_builddir)$(LIB_NAME)
- endif
- ifeq ($(strip $($(LIB_NAME)_FULL_NAME)),)
- $(LIB_NAME)_FULL_NAME:=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
- endif
- ifeq ($(strip $($(LIB_NAME)_SRC)),)
- ifeq ($(strip $($(LIB_NAME)_MSRC)),)
- $(LIB_NAME)_SRC:=$(wildcard $(srcdir)/*.c)
- endif
- endif
- ifeq ($(strip $($(LIB_NAME)_OBJ)),)
- $(LIB_NAME)_OBJ:=$(patsubst $(srcdir)/%.c,$($(LIB_NAME)_DIR)/%.o,$($(LIB_NAME)_SRC))
- endif
- $(LIB_NAME)_OBJ_PIC:=$(patsubst %.o,%.os,$($(LIB_NAME)_OBJ))
- $(LIB_NAME)_MOBJ_PIC:=$(patsubst %.o,%.os,$($(LIB_NAME)_MOBJ))
- $(LIB_NAME)_SOBJ_PIC:=$(patsubst %.o,%.os,$($(LIB_NAME)_SOBJ))
- #libso-y+=$(top_builddir)lib/$(LIB_NAME).so
- #liba-y+=$(top_builddir)lib/$(LIB_NAME).a
- #libclean-y+=$(LIB_NAME)_clean
- $($(LIB_NAME)_OBJ): %.o : %.c
- $(compile.c)
- $($(LIB_NAME)_OBJ_PIC): %.os : %.c
- $(compile.c) $(PICFLAG)
- $($(LIB_NAME)_MOBJ): $($(LIB_NAME)_MSRC)
- $(compile.m)
- $($(LIB_NAME)_MOBJ_PIC): $($(LIB_NAME)_MSRC)
- $(compile.m) $(PICFLAG)
- $($(LIB_NAME)_SOBJ): %.o : %.S
- $(compile.S)
- $($(LIB_NAME)_SOBJ_PIC): %.os : %.S
- $(compile.S) $(PICFLAG)
- # this should be changed to .os after libc/misc/internals/ is done
- libc:=$(top_builddir)lib/libc.so
- interp:=$(top_builddir)libc/misc/internals/interp.o
- ifeq ($(strip $(EXTRA_LINK_LIBS)),)
- #EXTRA_LINK_LIBS:=$(interp) -L$(top_builddir)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC)
- EXTRA_LINK_LIBS:=$(interp) $(libc) $(LDADD_LIBFLOAT) $(LIBGCC)
- endif
- $(top_builddir)lib/$(LIB_NAME).so: $($(LIB_NAME)_DIR)/$(LIB_NAME)_pic.a $(interp) $(libc)
- $(INSTALL) -d $(top_builddir)lib
- $(RM) $@ $@.$(MAJOR_VERSION) $(top_builddir)lib/$($(LIB_NAME)_FULL_NAME)
- $(LD) $(LDFLAGS) $(EXTRA_LINK_OPTS) -soname=$(notdir $@).$(MAJOR_VERSION) \
- -o $(top_builddir)lib/$($(LIB_NAME)_FULL_NAME) $(SHARED_START_FILES) \
- --whole-archive $(firstword $^) --no-whole-archive \
- $(EXTRA_LINK_LIBS) $(SHARED_END_FILES)
- $(LN) -sf $($(LIB_NAME)_FULL_NAME) $@.$(MAJOR_VERSION)
- $(LN) -sf $($(LIB_NAME)_FULL_NAME) $@
- $(top_builddir)lib/$(LIB_NAME).so1: $($(LIB_NAME)_OBJ_PIC) $($(LIB_NAME)_MOBJ_PIC) $($(LIB_NAME)_SOBJ_PIC) $($(LIB_NAME)_SO_ADD)
- $(INSTALL) -d $(top_builddir)lib
- $(RM) $@ $@.$(MAJOR_VERSION) $(top_builddir)lib/$($(LIB_NAME)_FULL_NAME)
- $(LD) $(LDFLAGS) $(EXTRA_LINK_OPTS) -soname=$(notdir $@).$(MAJOR_VERSION) \
- -o $(top_builddir)lib/$($(LIB_NAME)_FULL_NAME) $(SHARED_START_FILES) $^ \
- $(EXTRA_LINK_LIBS) $(SHARED_END_FILES)
- $(LN) -sf $($(LIB_NAME)_FULL_NAME) $@.$(MAJOR_VERSION)
- $(LN) -sf $($(LIB_NAME)_FULL_NAME) $@
- $($(LIB_NAME)_DIR)/$(LIB_NAME)_pic.a: $($(LIB_NAME)_OBJ_PIC) $($(LIB_NAME)_MOBJ_PIC) $($(LIB_NAME)_SOBJ_PIC) $($(LIB_NAME)_SO_ADD)
- ifneq ($(strip $(STRIP_FLAGS)),)
- $(STRIPTOOL) $(STRIP_FLAGS) $^
- else
- $(STRIPTOOL) -x -R .note -R .comment $^
- endif
- $(AR) $(ARFLAGS) $@ $^
- ifeq ($(DOPIC),y)
- $(top_builddir)lib/$(LIB_NAME).a: $($(LIB_NAME)_DIR)/$(LIB_NAME)_pic.a
- $(RM) $@
- cp $< $@
- else
- $(top_builddir)lib/$(LIB_NAME).a: $($(LIB_NAME)_OBJ) $($(LIB_NAME)_MOBJ) $($(LIB_NAME)_SOBJ) $($(LIB_NAME)_A_ADD)
- $(RM) $@
- $(STRIPTOOL) -x -R .note -R .comment $^
- $(AR) $(ARFLAGS) $@ $^
- endif
- $(LIB_NAME)_clean:
- rm -f $($(LIB_NAME)_DIR)/*.{o,os,a}
- endif
- include $(top_srcdir)Makerules
|