2003-07-16 01:53:15 +02:00
|
|
|
# $RCSfile: Makefile.rule,v $
|
2010-06-06 23:28:14 +02:00
|
|
|
# $Revision: 1.5 $
|
2003-07-16 01:53:15 +02:00
|
|
|
# $Name: $
|
2010-06-06 23:28:14 +02:00
|
|
|
# $Date: 2010/06/06 21:28:14 $
|
2003-07-16 01:53:15 +02:00
|
|
|
# $Author: agibert $
|
|
|
|
|
2003-07-17 00:55:51 +02:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Rule Makefile
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2003-07-16 01:53:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
# ----------------- DEFAULT RULES ---------------------
|
|
|
|
default:all
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------- IMPLICITES RULES ---------------------
|
|
|
|
|
|
|
|
# Here are all the rules allowing to compile sources files
|
|
|
|
# c -> o
|
|
|
|
%.o:%.c
|
2010-06-06 23:28:14 +02:00
|
|
|
$(CC) $(CFLAGS) $(INCLUDE) -fPIC -c $< -o $@
|
2003-07-16 01:53:15 +02:00
|
|
|
|
|
|
|
# c -> executable
|
|
|
|
.c :
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDE) $< -o $@ -I . $(LIB)
|
|
|
|
|
|
|
|
# o -> executable
|
|
|
|
%:%.o
|
|
|
|
$(CC) $(LFLAGS) -o $@ $? $(LIB)
|
|
|
|
|
|
|
|
# .o -> .so
|
|
|
|
%.so:%.o
|
|
|
|
$(CC) $(LDSOFLAGS) -shared -o $@ $? $(LIB)
|
|
|
|
|
|
|
|
%.a:%.o
|
|
|
|
$(AR) -r $@ $?
|
|
|
|
|
|
|
|
$(OBJECTS) : $(SRC)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "depend" rule allow to build the dependancy file
|
|
|
|
depend:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "all" Rule
|
|
|
|
all: dir_all
|
|
|
|
ifneq ($(SUBDIRS),)
|
|
|
|
for d in $(SUBDIRS) ; do $(MAKE) all -C $$d/ ; done
|
|
|
|
endif
|
|
|
|
|
|
|
|
dir_all: $(TARGETS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "clean" Rule
|
|
|
|
clean: dir_clean
|
|
|
|
ifneq ($(SUBDIRS),)
|
|
|
|
for d in $(SUBDIRS) ; do $(MAKE) clean -C $$d/ ; done
|
|
|
|
endif
|
|
|
|
|
|
|
|
dir_clean:
|
|
|
|
@(command="$(RM) $(TARGETS) $$(echo $(SRC) | sed "s/\.c/\.o/g") ;" ; \
|
|
|
|
echo $$command ; \
|
|
|
|
eval $$command ;)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "pre_install" Rule
|
|
|
|
# This empty rule can be overiden in module Makefile in order to run pre-install commands.
|
|
|
|
pre_install:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "post_install" Rule
|
|
|
|
# This empty rule can be overiden in module Makefile in order to run post-install commands.
|
|
|
|
post_install:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "install" Rule
|
|
|
|
install: dir_install
|
|
|
|
ifneq ($(SUBDIRS),)
|
|
|
|
for d in $(SUBDIRS) ; do $(MAKE) install -C $$d/ ; done
|
|
|
|
endif
|
|
|
|
|
|
|
|
dir_install: dir_all
|
|
|
|
$(MAKE) pre_install
|
|
|
|
ifneq ($(FILE_BIN),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_BIN) ; then $(MKDIR) $(PATH_BIN) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLBIN) $(FILE_BIN) $(PATH_BIN)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_BINSUID),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_BINSUID) ; then $(MKDIR) $(PATH_BINSUID) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLBINSUID) $(FILE_BINSUID) $(PATH_BINSUID)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_CGI),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_CGI) ; then $(MKDIR) $(PATH_CGI) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLCGI) $(FILE_CGI) $(PATH_CGI)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_DOC),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_DOC) ; then $(MKDIR) $(PATH_DOC) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLDOC) $(FILE_DOC) $(PATH_DOC)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_ETC),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_ETC) ; then $(MKDIR) $(PATH_ETC) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLETC) $(FILE_ETC) $(PATH_ETC)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_HOME),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_HOME) ; then $(MKDIR) $(PATH_HOME) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLHOME) $(FILE_HOME) $(PATH_HOME)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_HOMEBIN),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_HOMEBIN) ; then $(MKDIR) $(PATH_HOMEBIN) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLHOMEBIN) $(FILE_HOMEBIN) $(PATH_HOMEBIN)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_LIB),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_LIB) ; then $(MKDIR) $(PATH_LIB) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLLIB) $(FILE_LIB) $(PATH_LIB)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_HOMELIB),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_HOMELIB) ; then $(MKDIR) $(PATH_HOMELIB) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLHOMELIB) $(FILE_HOMELIB) $(PATH_HOMELIB)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_INCLUDE),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_INCLUDE) ; then $(MKDIR) $(PATH_INCLUDE) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLINCLUDE) $(FILE_INCLUDE) $(PATH_INCLUDE)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_MAN),)
|
|
|
|
@for d in $(FILE_MAN) ; do \
|
|
|
|
if test ! -d $(PATH_MAN)/$(FILE_MAN) ; then \
|
2003-07-17 01:17:07 +02:00
|
|
|
$(MKDIR) $(PATH_MAN)/$(FILE_MAN) ; \
|
2003-07-16 01:53:15 +02:00
|
|
|
fi ; \
|
|
|
|
$(INSTALLMAN) $(FILE_MAN)/* $(PATH_MAN)/$(FILE_MAN) ; \
|
|
|
|
done
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_WEBCONF),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_WEBCONF) ; then $(MKDIR) $(PATH_WEBCONF) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLWEBCONF) $(FILE_WEBCONF) $(PATH_WEBCONF)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_WEBCONFSSL),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_WEBCONFSSL) ; then $(MKDIR) $(PATH_WEBCONFSSL) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLWEBCONFSSL) $(FILE_WEBCONFSSL) $(PATH_WEBCONFSSL)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_HTML),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_HTML) ; then $(MKDIR) $(PATH_HTML) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLHTML) $(FILE_HTML) $(PATH_HTML)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_WEBICONS),)
|
2003-07-17 01:17:07 +02:00
|
|
|
@if test ! -d $(PATH_WEBICONS) ; then $(MKDIR) $(PATH_WEBICONS) ; fi
|
2003-07-16 01:53:15 +02:00
|
|
|
$(INSTALLWEBICONS) $(FILE_WEBICONS) $(PATH_WEBICONS)
|
|
|
|
endif
|
|
|
|
$(MAKE) post_install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "pre_uninstall" Rule
|
|
|
|
# This empty rule can be overiden in module Makefile in order to run pre-uninstall commands.
|
|
|
|
|
|
|
|
pre_uninstall:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "post_uninstall" Rule
|
|
|
|
# This empty rule can be overiden in module Makefile in order to run post-uninstall commands.
|
|
|
|
post_uninstall:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "uninstall" Rule
|
|
|
|
uninstall: dir_uninstall
|
|
|
|
ifneq ($(SUBDIRS),)
|
|
|
|
for d in $(SUBDIRS) ; do $(MAKE) uninstall -C $$d/ ; done
|
|
|
|
endif
|
|
|
|
|
|
|
|
dir_uninstall:
|
|
|
|
$(MAKE) pre_uninstall
|
|
|
|
ifneq ($(FILE_BIN),)
|
|
|
|
@(if test -d $(PATH_BIN) ; then \
|
|
|
|
$(CD) $(PATH_BIN) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_BIN)" ; \
|
|
|
|
echo "$(RM) $(FILE_BIN)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_BIN) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_BINSUID),)
|
|
|
|
@(if test -d $(PATH_BINSUID) ; then \
|
|
|
|
$(CD) $(PATH_BINSUID) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_BINSUID)" ; \
|
|
|
|
echo "$(RM) $(FILE_BINSUID)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_BINSUID) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_CGI),)
|
|
|
|
@(if test -d $(PATH_CGI) ; then \
|
|
|
|
$(CD) $(PATH_CGI) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_CGI)" ; \
|
|
|
|
echo "$(RM) $(FILE_CGI)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_CGI) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_DOC),)
|
|
|
|
@(if test -d $(PATH_DOC) ; then \
|
|
|
|
$(CD) $(PATH_DOC) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_DOC)" ; \
|
|
|
|
echo "$(RM) $(FILE_DOC)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_DOC) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_ETC),)
|
|
|
|
@(if test -d $(PATH_ETC) ; then \
|
|
|
|
$(CD) $(PATH_ETC) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_ETC)" ; \
|
|
|
|
echo "$(RM) $(FILE_ETC)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_ETC) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_HOME),)
|
|
|
|
@(if test -d $(PATH_HOME) ; then \
|
|
|
|
$(CD) $(PATH_HOME) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_HOME)" ; \
|
|
|
|
echo "$(RM) $(FILE_HOME)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_HOME) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_HOMEBIN),)
|
|
|
|
@(if test -d $(PATH_HOMEBIN) ; then \
|
|
|
|
$(CD) $(PATH_HOMEBIN) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_HOMEBIN)" ; \
|
|
|
|
echo "$(RM) $(FILE_HOMEBIN)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_HOMEBIN) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_LIB),)
|
|
|
|
@(if test -d $(PATH_LIB) ; then \
|
|
|
|
$(CD) $(PATH_LIB) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_LIB)" ; \
|
|
|
|
echo "$(RM) $(FILE_LIB)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_LIB) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_HOMELIB),)
|
|
|
|
@(if test -d $(PATH_HOMELIB) ; then \
|
|
|
|
$(CD) $(PATH_HOMELIB) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_HOMELIB)" ; \
|
|
|
|
echo "$(RM) $(FILE_HOMELIB)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_HOMELIB) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_INCLUDE),)
|
|
|
|
@(if test -d $(PATH_INCLUDE) ; then \
|
|
|
|
$(CD) $(PATH_INCLUDE) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_INCLUDE)" ; \
|
|
|
|
echo "$(RM) $(FILE_INCLUDE)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_INCLUDE) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_MAN),)
|
|
|
|
@(if test -d $(PATH_MAN) ; then \
|
|
|
|
$(CD) $(PATH_MAN) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_MAN)" ; \
|
|
|
|
echo "$(RM) $(FILE_MAN)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_MAN) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_WEBCONF),)
|
|
|
|
@(if test -d $(PATH_WEBCONF) ; then \
|
|
|
|
$(CD) $(PATH_WEBCONF) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_WEBCONF)" ; \
|
|
|
|
echo "$(RM) $(FILE_WEBCONF)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_WEBCONF) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_WEBCONFSSL),)
|
|
|
|
@(if test -d $(PATH_WEBCONFSSL) ; then \
|
|
|
|
$(CD) $(PATH_WEBCONFSSL) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_WEBCONFSSL)" ; \
|
|
|
|
echo "$(RM) $(FILE_WEBCONFSSL)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_WEBCONFSSL) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_HTML),)
|
|
|
|
@(if test -d $(PATH_HTML) ; then \
|
|
|
|
$(CD) $(PATH_HTML) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_HTML)" ; \
|
|
|
|
echo "$(RM) $(FILE_HTML)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_HTML) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
ifneq ($(FILE_WEBICONS),)
|
|
|
|
@(if test -d $(PATH_WEBICONS) ; then \
|
|
|
|
$(CD) $(PATH_WEBICONS) ; \
|
|
|
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
|
|
|
if [ $$? -ne 0 ] ; then \
|
|
|
|
echo "$(CD) $(PATH_WEBICONS)" ; \
|
|
|
|
echo "$(RM) $(FILE_WEBICONS)" ; \
|
|
|
|
fi ; \
|
|
|
|
$(RM) $(FILE_WEBICONS) ; \
|
|
|
|
fi)
|
|
|
|
endif
|
|
|
|
$(MAKE) post_uninstall
|
2003-07-17 00:55:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "distrib" Rule
|
|
|
|
distrib:
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MKDIR) $(TMP_DIR)/$(PROG_VERSION_NAME)
|
|
|
|
$(TAR) cf - . | $(TAR) xvpf - -C $(TMP_DIR)/$(PROG_VERSION_NAME)
|
2003-07-17 01:37:37 +02:00
|
|
|
$(TAR) cvf - -C $(TMP_DIR) --exclude CVS $(PROG_VERSION_NAME) | $(GZIP) -9 >$(PROG_VERSION_NAME).src.tgz
|
|
|
|
$(TAR) cvf - -C $(TMP_DIR) --exclude CVS $(PROG_VERSION_NAME) | $(BZIP2) -9 >$(PROG_VERSION_NAME).src.tbz2
|
2003-07-17 00:55:51 +02:00
|
|
|
$(MV) $(TMP_DIR)/$(PROG_VERSION_NAME) .
|
2003-07-17 01:37:37 +02:00
|
|
|
$(ZIP) -r -m -9 $(PROG_VERSION_NAME).src.zip $(PROG_VERSION_NAME) -x \*/CVS/\*
|
|
|
|
$(RM) -r $(PROG_VERSION_NAME)
|