jw-pkg/make/lib.mk

86 lines
1.7 KiB
Makefile

# generic utility modules
# (c) 2001 jannet it services
# contact@jannet.de
# $Id$
include $(MODDIR)/make/defs.mk
include $(MODDIR)/make/rules.mk
all:
ifeq ($(USE_PROJECT_LIB),false)
ifeq ($(TARGET),mingw)
SHOBJS += $(wildcard *.dll)
else
SHOBJS += $(wildcard *.so)
endif
all:
install:
else
all: $(LD_CONF) $(LIB_SO) $(LINKS_SO) $(MSVCPP_IMPLIB) $(STRIP_DONE)
install: install_LIB install_LD_CONF
endif
clean: libclean local_libclean clean.ld-conf
distclean: clean
local_libclean: clean.mingw clean.unix clean.all
clean.unix:
ifneq ($(TARGET),mingw)
rm -rf *.so.* *.so st*
endif
clean.mingw:
ifeq ($(TARGET),mingw)
rm -rf *.dll *.def *.exp *.lib
endif
clean.all:
rm -rf *.a *.o *~ st* .*.swp *.done ld-*.conf
ld-%.conf:
echo $(INSTALL_LIBDIR) > $@.tmp
mv $@.tmp $@
clean.ld-conf:
rm -f $(LD_CONF)
echo.libs:
@echo INSTALLED_LIB_SO = $(INSTALLED_LIB_SO)
@echo INSTALLED_LIB = $(INSTALLED_LIB)
install-links:
l=$(shell pwd)/$(notdir $(INSTALLED_LIB_SO)) ;\
cd $(dir $(INSTALLED_LIB_SO)) &&\
sudo ln -sf $$l
# ------------------------------------------ contrib libraries
# deps on mandatory targets
all: $(CONTRIB_LIBS)
clean: clean.contrib-libs
# deps on optional targets
echo-contrib: echo.contrib-libs echo.libs
# rules
clean.contrib-libs:
rm -f $(CONTRIB_LIBS)
define contrib_lib_search_rules
%.dll: $(1)/%.dll
cp -p $$< $$@
endef
$(foreach p,$(CONTRIB_LIBS_PATH),$(eval $(call contrib_lib_search_rules,$(p))))
echo.contrib-libs:
@echo CONTRIB_LIBS_PATH = $(CONTRIB_LIBS_PATH)
@echo CONTRIB_LIBS = $(CONTRIB_LIBS)
ifeq ($(TARGET),mingw)
clean.winres:
rm -f $(WINRES_RC) $(WINRES_O) *.tmp
clean: clean.winres
#%.o : %.rc
# $(WINDRES) $^ -o $@
endif