1 SRC_DIR
:= $(SRC_PATH_BARE
)/lib
$(NAME
)
3 include $(SUBDIR
)..
/common.mak
5 LIBVERSION
:= $(lib
$(NAME
)_VERSION
)
6 LIBMAJOR
:= $(lib
$(NAME
)_VERSION_MAJOR
)
9 all: $(SUBDIR
)$(LIBNAME
)
11 install-libs
: install-lib
$(NAME
)-static
13 $(SUBDIR
)$(LIBNAME
): $(OBJS
)
15 $(AR
) rc
$@
$^
$(EXTRAOBJS
)
19 INCINSTDIR
:= $(INCDIR
)/lib
$(NAME
)
21 THIS_LIB
:= $(SUBDIR
)$($(CONFIG_SHARED
:yes
=S
)LIBNAME
)
24 $(SUBDIR
)%$(EXESUF
): $(SUBDIR
)%.o
25 $(LD
) $(FFLDFLAGS
) -o
$$@
$$^
-l
$(FULLNAME
) $(FFEXTRALIBS
) $$(ELIBS
)
27 $(SUBDIR
)%-test.o
: $(SUBDIR
)%.c
28 $(CC
) $(CPPFLAGS
) $(CFLAGS
) -DTEST
-c
-o
$$@
$$^
30 $(SUBDIR
)%-test.o
: $(SUBDIR
)%-test.c
31 $(CC
) $(CPPFLAGS
) $(CFLAGS
) -DTEST
-c
-o
$$@
$$^
33 $(SUBDIR
)x86
/%.o
: $(SUBDIR
)x86
/%.asm
34 $(YASM
) $(YASMFLAGS
) -I
$$(<D
)/ -M
-o
$$@
$$< > $$(@
:.o
=.d
)
35 $(YASM
) $(YASMFLAGS
) -I
$$(<D
)/ -o
$$@
$$<
38 rm -f
$(addprefix $(SUBDIR
),*-example
$(EXESUF
) *-test$(EXESUF
) $(CLEANFILES
) $(CLEANSUFFIXES
) $(LIBSUFFIXES
)) \
39 $(addprefix $(SUBDIR
), $(foreach suffix,$(CLEANSUFFIXES
),$(addsuffix /$(suffix),$(DIRS
)))) \
40 $(HOSTOBJS
) $(HOSTPROGS
)
43 rm -f
$(addprefix $(SUBDIR
),$(DISTCLEANSUFFIXES
)) \
44 $(addprefix $(SUBDIR
), $(foreach suffix,$(DISTCLEANSUFFIXES
),$(addsuffix /$(suffix),$(DIRS
))))
47 all: $(SUBDIR
)$(SLIBNAME
)
49 install-libs
: install-lib
$(NAME
)-shared
51 $(SUBDIR
)$(SLIBNAME
): $(SUBDIR
)$(SLIBNAME_WITH_MAJOR
)
52 cd .
/$(SUBDIR
) && $(LN_S
) $(SLIBNAME_WITH_MAJOR
) $(SLIBNAME
)
54 $(SUBDIR
)$(SLIBNAME_WITH_MAJOR
): $(OBJS
)
55 $(SLIB_CREATE_DEF_CMD
)
56 $(LD
) $(SHFLAGS
) $(FFLDFLAGS
) -o
$$@
$$(filter %.o
,$$^
) $(FFEXTRALIBS
) $(EXTRAOBJS
)
60 $(SUBDIR
)$(SLIBNAME_WITH_MAJOR
): $(DEP_LIBS
)
64 install-lib
$(NAME
)-shared
: $(SUBDIR
)$(SLIBNAME
)
65 install -d
"$(SHLIBDIR)"
66 install -m
755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
67 $(STRIP
) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
69 $(LN_S
) $(SLIBNAME_WITH_VERSION
) $(SLIBNAME_WITH_MAJOR
)
71 $(LN_S
) $(SLIBNAME_WITH_VERSION
) $(SLIBNAME
)
72 $(SLIB_INSTALL_EXTRA_CMD
)
74 install-lib
$(NAME
)-static
: $(SUBDIR
)$(LIBNAME
)
75 install -d
"$(LIBDIR)"
76 install -m
644 $$< "$(LIBDIR)"
77 $(LIB_INSTALL_EXTRA_CMD
)
80 install -d
"$(INCINSTDIR)"
81 install -d
"$(LIBDIR)/pkgconfig"
82 install -m
644 $(addprefix "$(SRC_DIR)"/,$(HEADERS
)) "$(INCINSTDIR)"
83 install -m
644 $(BUILD_ROOT
)/lib
$(NAME
)/lib
$(NAME
).
pc "$(LIBDIR)/pkgconfig"
86 -rm -f
"$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
87 "$(SHLIBDIR)/$(SLIBNAME)" \
88 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
89 -$(SLIB_UNINSTALL_EXTRA_CMD
)
90 -rm -f
"$(LIBDIR)/$(LIBNAME)"
93 rm -f
$(addprefix "$(INCINSTDIR)/",$(HEADERS
))
94 rm -f
"$(LIBDIR)/pkgconfig/lib$(NAME).pc"
100 $(EXAMPLES
) $(TESTPROGS
): $(THIS_LIB
) $(DEP_LIBS
)
102 examples
: $(EXAMPLES
)
103 testprogs
: $(TESTPROGS
)