2 # common bits used by all libraries
5 # first so "all" becomes default target
8 include $(SRC_PATH
)/arch.mak
11 FFLIBS
:= $(FFLIBS-yes
) $(FFLIBS
)
12 TESTPROGS
+= $(TESTPROGS-yes
)
14 LDLIBS
= $(FFLIBS
:%=%$(BUILDSUF
))
15 FFEXTRALIBS
:= $(LDLIBS
:%=$(LD_LIB
)) $(EXTRALIBS
)
17 EXAMPLES
:= $(EXAMPLES
:%=$(SUBDIR
)%-example
$(EXESUF
))
18 OBJS
:= $(sort $(OBJS
:%=$(SUBDIR
)%))
19 TESTOBJS
:= $(TESTOBJS
:%=$(SUBDIR
)%) $(TESTPROGS
:%=$(SUBDIR
)%-test.o
)
20 TESTPROGS
:= $(TESTPROGS
:%=$(SUBDIR
)%-test$(EXESUF
))
21 HOSTOBJS
:= $(HOSTPROGS
:%=$(SUBDIR
)%.o
)
22 HOSTPROGS
:= $(HOSTPROGS
:%=$(SUBDIR
)%$(HOSTEXESUF
))
24 TOOLOBJS
:= $(TOOLS
:%=tools
/%.o
)
25 TOOLS
:= $(TOOLS
:%=tools
/%$(EXESUF
))
26 HEADERS
+= $(HEADERS-yes
)
28 DEP_LIBS
:= $(foreach NAME
,$(FFLIBS
),lib
$(NAME
)/$($(CONFIG_SHARED
:yes
=S
)LIBNAME
))
30 ALLHEADERS
:= $(subst $(SRC_DIR
)/,$(SUBDIR
),$(wildcard $(SRC_DIR
)/*.h
$(SRC_DIR
)/$(ARCH
)/*.h
))
31 SKIPHEADERS
+= $(ARCH_HEADERS
:%=$(ARCH
)/%) $(SKIPHEADERS-
)
32 SKIPHEADERS
:= $(SKIPHEADERS
:%=$(SUBDIR
)%)
33 HOBJS
= $(filter-out $(SKIPHEADERS
:.h
=.h.o
),$(ALLHEADERS
:.h
=.h.o
))
34 checkheaders
: $(HOBJS
)
35 .SECONDARY
: $(HOBJS
:.o
=.c
)
40 $(call COMPILE
,HOSTCC
)
42 $(HOSTPROGS
): %$(HOSTEXESUF
): %.o
43 $(HOSTLD
) $(HOSTLDFLAGS
) $(HOSTLD_O
) $< $(HOSTLIBS
)
45 $(OBJS
): |
$(sort $(dir $(OBJS
)))
46 $(HOSTOBJS
): |
$(sort $(dir $(HOSTOBJS
)))
47 $(TESTOBJS
): |
$(sort $(dir $(TESTOBJS
)))
50 OBJDIRS
:= $(OBJDIRS
) $(dir $(OBJS
) $(HOSTOBJS
) $(TESTOBJS
))
52 CLEANSUFFIXES
= *.d
*.o
*~
*.h.c
*.map
*.ver
53 DISTCLEANSUFFIXES
= *.
pc
54 LIBSUFFIXES
= *.a
*.lib
*.so
*.so.
* *.dylib
*.dll
*.def
*.dll.a
58 $(RM
) $(OBJS
) $(OBJS
:.o
=.d
)
65 -include $(wildcard $(OBJS
:.o
=.d
) $(HOSTOBJS
:.o
=.d
) $(TESTOBJS
:.o
=.d
) $(HOBJS
:.o
=.d
))