2 # Most of the libraries just generate object files that
3 # are later linked in build into the libGP.so
6 $(error LIBNAME not defined
, fix your library Makefile
)
11 # Rules for single library, applied only when objects
12 # are not linked to the libGP.so. This generates libGP_$(LIBNAME).
15 include $(TOPDIR
)/libver.mk
17 LIB_NAME
=libGP_
$(LIBNAME
)
18 BUILD_DIR
=$(TOPDIR
)/build
/
20 STATIC_LIB
=$(LIB_NAME
).
$(LIB_VERSION
).a
21 DYNAMIC_LIB
=$(LIB_NAME
).so.
$(LIB_VERSION
).
$(LIB_RELEASE
)
22 SONAME
=$(LIB_NAME
).so.
$(LIB_MAJOR
)
23 SYMLINKS
=$(LIB_NAME
).so.
$(LIB_MAJOR
) $(LIB_NAME
).so
25 LIBS
=$(BUILD_DIR
)$(STATIC_LIB
) $(BUILD_DIR
)$(DYNAMIC_LIB
)
27 ALL
+=$(LIBS
) $(SYMLINKS
)
28 CLEAN
+=$(LIBS
) $(addprefix $(BUILD_DIR
),$(SYMLINKS
))
31 # OBJECTS are set in post.mk so we need to duplicate the values in
32 # OBJS here too to have correct dependencies
34 OBJS
=$(CSOURCES
:.c
=.o
)
36 $(BUILD_DIR
)$(DYNAMIC_LIB
): $(OBJS
)
39 $(CC
) -fPIC
--shared
-Wl
,-soname
-Wl
,$(SONAME
) $^
-o
$@
43 @
$(CC
) -fPIC
--shared
-Wl
,-soname
-Wl
,$(SONAME
) $^
-o
$@
46 $(BUILD_DIR
)$(STATIC_LIB
): $(OBJS
)
54 $(SYMLINKS
): $(BUILD_DIR
)$(DYNAMIC_LIB
)
57 cd
$(BUILD_DIR
) && ln
-s
$(DYNAMIC_LIB
) $@
61 @cd
$(BUILD_DIR
) && ln
-s
$(DYNAMIC_LIB
) $@
66 # If we are not executed from the top Makefile, trigger
69 include $(TOPDIR
)/config.mk
75 @
$(MAKE
) --no-print-directory
-C
$(TOPDIR
)/build
/