# *** Makefile *** Generated Makefile, PLEASE DON'T EDIT. # ./0 # # This is a *generated* Makefile, please don't edit ;)) # Copyright (C) 2002 Raúl Núñez de Arenas Coronado # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; # either version 2 of the License, # or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # ('GPL') along with this program; if not, write to: # # Free Software Foundation, Inc. # 59 Temple Place, Suite 330 # Boston, MA 02111-1307 USA # # Report bugs to
# .PHONY: all install help clean .DELETE_ON_ERROR: .SECONDARY: .SUFFIXES: .SUFFIXES:.c .o .h .d .a .so .DEFAULT:;@: # Convenience variables override GOALS= override XDEFS:=-DCONFDIR=\"/usr/local/etc/\" -DDATADIR=\"/usr/local/lib/vcinit/\" override OBJECTS=$(sort $(patsubst %.c, %.o, $(wildcard src/*.c lib/*.c))) override DEPENDS=$(sort $(patsubst %.c, %.d, $(wildcard src/*.c lib/*.c bin/*.c sbin/*.c))) # Goals to build override GOALS+=$(if $(filter src/%.o, $(OBJECTS)),src/library.a) override GOALS+=$(if $(filter lib/%.o, $(OBJECTS)),lib/libvcinit.a) override GOALS+=$(if $(filter lib/%.o, $(OBJECTS)),lib/libvcinit.so) override GOALS+=$(basename $(wildcard bin/*.c sbin/*.c)) all: $(GOALS) # Misc functions for installation (David and myself). # This function install files to their proper location (just *files*), # logging the names of those installed files in the process... install_files=\ $(foreach filename,$(wildcard $(1)),{\ [ -d $(filename) ] || {\ cp -f $(filename) $(2) > /dev/null 2>&1 || {\ printf "Couldn't install file \"$(filename)\", aborting.\n";\ exit 1;\ };\ chmod $(3) $(2)$(notdir $(filename));\ printf "$(2)$(notdir $(filename))\n";\ };\ };) # This function creates installation directories makedir=\ if [ ! -z "$(1)" ];\ then\ [ -d "$(1)" ] || mkdir -m 755 -p "$(1)" > /dev/null 2>&1 || {\ printf "Cannot create directory \"$(1)\", aborting...\n";\ exit 1;\ };\ fi install: all @$(call makedir,/usr/local/) @$(call makedir,/usr/local/bin/) @$(call makedir,/usr/local/sbin/) @$(call makedir,/usr/local/lib/) @$(call makedir,/usr/local/man/man1) @$(call makedir,/usr/local/man/man5) @$(call makedir,/usr/local/man/man8) @$(call makedir,/usr/local/info/) @$(call makedir,/usr/local/doc/vcinit/) @$(call makedir,/usr/local/etc/) @$(call makedir,/usr/local/lib/vcinit/) @$(call makedir,/usr/local/include/vcinit/) @$(call install_files,$(filter bin/%, $(filter-out bin/_%,$(GOALS))),/usr/local/bin/,555) @$(call install_files,$(filter sbin/%, $(filter-out sbin/_%,$(GOALS))),/usr/local/sbin/,555) @$(call install_files,doc/*.1,/usr/local/man/,444) @$(call install_files,doc/*.8,/usr/local/man/,444) @$(call install_files,doc/*.5,/usr/local/man/,444) @$(call install_files,doc/*.info,/usr/local/info/,444) @$(call install_files,doc/*.html,/usr/local/doc/vcinit/,444) @$(call install_files,doc/*.txt,/usr/local/doc/vcinit/,444) @$(call install_files,include/*.h,/usr/local/include/vcinit/,444) @$(call install_files,lib/*.h,/usr/local/include/vcinit/,444) @$(call install_files,lib/libvcinit.a,/usr/local/lib/,444) @$(call install_files,lib/libvcinit.so,/usr/local/lib/,555) @if [ -e /usr/local/lib/libvcinit.so ] ;\ then \ ln -sf /usr/local/lib/libvcinit.so /usr/local/lib/libvcinit.so.1 ;\ printf "/usr/local/lib/libvcinit.so.1\n" ;\ fi @$(foreach filename,$(wildcard conf/*), \ { \ [ -f /usr/local/etc/$(notdir $(filename)) ] && \ mv -f /usr/local/etc/$(notdir $(filename)) \ /usr/local/etc/$(notdir $(filename))~ \ > /dev/null 2>&1;\ } || true ; ) @$(call install_files,conf/*,/usr/local/etc/,644) @if [ -e data/Makefile ] ;\ then \ $(MAKE) -C data -f Makefile DATADIR=/usr/local/lib/vcinit/ ;\ else \ $(call install_files,data/*,/usr/local/lib/vcinit/,444) true ;\ fi @rmdir -p \ /usr/local/ /usr/local/bin/ /usr/local/sbin/ \ /usr/local/man/man1 /usr/local/man/man8 /usr/local/man/man5 /usr/local/man/ \ /usr/local/info/ /usr/local/doc/vcinit/ /usr/local/etc/ /usr/local/lib/vcinit/ /usr/local/lib/ /usr/local/include/vcinit/ \ > /dev/null 2>&1 || true help: @printf "\n" @printf " Run the command 'make