From 5700573a46c2ab60794ba9e45da35e712e8fa6d3 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 2 Jul 2002 16:04:41 +0000 Subject: [PATCH] bin, make, scripts: Copy scripts to $(MODDIR)/bin --- bin/Makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ make/defs-orig.mk | 47 ++++++++++++++++++++++++----------------------- make/header.mk | 2 +- make/rules.mk | 3 +++ make/scripts.mk | 2 +- make/tools.mk | 2 +- scripts/Makefile | 6 +++--- 7 files changed, 78 insertions(+), 29 deletions(-) create mode 100644 bin/Makefile diff --git a/bin/Makefile b/bin/Makefile new file mode 100644 index 00000000..8172612b --- /dev/null +++ b/bin/Makefile @@ -0,0 +1,45 @@ +######################################################################## +# # +# development utilities # +# (c) 2001 jannet it services # +# Authors: Jan Lindemann # +# contact@jannet.de # +# patches, bugfixes and comments are welcome at patch@jannet.de # +# # +# $Id$ +# # +# This program is free software; permission to use, copy, modify, # +# distribute, and sell this software and its documentation under the # +# terms of the GNU Public license as published by the Free Software # +# Foundation, either version 2 or any later version of the license, is # +# hereby granted without fee, provided that (i) the above copyright # +# notices and this permission notice appear in all copies of the # +# software and related documentation, and (ii) the name of jannet may # +# not be used in any advertising or publicity relating to the software # +# without the specific, prior written permission of jannet. # +# # +# This program is distributed in the hope that it will be useful, but # +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- # +# TABILITY 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 # +# along with this program; if not, write to the Free Software Founda- # +# tion, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # +# # +######################################################################## + +MODDIR = .. + +CLEAN += $(wildcard *.sh) + +include $(MODDIR)/make/scripts.mk + +all: + +$(INSTALL_BINDIR): + $(INSTALL) -o root -g root -m 755 -d $@ + +install: $(INSTALL_BINDIR) $(INSTALLED_EXE_SH) + +profclean: diff --git a/make/defs-orig.mk b/make/defs-orig.mk index 64df6679..548a2a17 100644 --- a/make/defs-orig.mk +++ b/make/defs-orig.mk @@ -59,33 +59,34 @@ GCC_REV = $(shell gcc -v 2>&1 | grep version | awk '{ split($$3,a,"."); pri CPP = g++ -EXE_SH = $(wildcard *.sh) -MKFILES = $(wildcard *.mk) +EXE_SH = $(wildcard *.sh) +MKFILES = $(wildcard *.mk) -CFILES = $(wildcard *.c) -CPPFILES = $(wildcard *.cc *.cpp) -CALLSRC = $(CFILES) $(CPPFILES) -OBJ = $(patsubst %.cpp,%.o,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(CALLSRC)))) -SHOBJS = $(patsubst %.cpp,%.o,$(patsubst %.cc,lib%.so,$(patsubst %.c,lib%.so,$(CALLSRC)))) -SHSCRIPTS = $(patsubst %.sh.tmpl,%.sh,$(wildcard *.sh.tmpl)) -SCRIPTS = $(patsubst %.tmpl,%,$(wildcard *.tmpl)) -INST_HDRS = $(patsubst %.h,$(TOPDIR)/include/%.h,$(wildcard *.h)) +CFILES = $(wildcard *.c) +CPPFILES = $(wildcard *.cc *.cpp) +CALLSRC = $(CFILES) $(CPPFILES) +OBJ = $(patsubst %.cpp,%.o,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(CALLSRC)))) +SHOBJS = $(patsubst %.cpp,%.o,$(patsubst %.cc,lib%.so,$(patsubst %.c,lib%.so,$(CALLSRC)))) +SHSCRIPTS = $(patsubst %.sh.tmpl,%.sh,$(wildcard *.sh.tmpl)) +SCRIPTS = $(patsubst %.tmpl,%,$(wildcard *.tmpl)) +LOCAL_HDR = $(patsubst %.h,$(TOPDIR)/include/%.h,$(wildcard *.h)) +LOCAL_EXE_SH = $(patsubst %.sh,$(TOPDIR)/bin/%.sh,$(wildcard *.sh)) -LOCAL_H = $(wildcard *.h) -LOCAL_C = $(wildcard *.c) -LOCAL_CPP = $(wildcard *.c *.cpp *.cc *.C) -LOCAL_CSRC = $(LOCAL_H) $(LOCAL_C) $(LOCAL_CPP) +LOCAL_H = $(wildcard *.h) +LOCAL_C = $(wildcard *.c) +LOCAL_CPP = $(wildcard *.c *.cpp *.cc *.C) +LOCAL_CSRC = $(LOCAL_H) $(LOCAL_C) $(LOCAL_CPP) -PREREQ_DIR = $(addprefix $(MODDIR)/,$(LOCAL_PREREQ)) -PREREQ_DONE = $(addsuffix /all.done,$(PREREQ_DIR)) -PREREQ_H = $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.h)) -PREREQ_C = $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.c)) -PREREQ_CPP = $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.c)) \ +PREREQ_DIR = $(addprefix $(MODDIR)/,$(LOCAL_PREREQ)) +PREREQ_DONE = $(addsuffix /all.done,$(PREREQ_DIR)) +PREREQ_H = $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.h)) +PREREQ_C = $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.c)) +PREREQ_CPP = $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.c)) \ $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.cpp)) -PREREQ_CSRC = $(PREREQ_H) $(PREREQ_C) $(PREREQ_CPP) +PREREQ_CSRC = $(PREREQ_H) $(PREREQ_C) $(PREREQ_CPP) -CONTRIB_MOD = $(addprefix contrib/,$(CONTRIB_LIBS)) -REQUIRED := $(CONTRIB_MOD) $(REQUIRED) +CONTRIB_MOD = $(addprefix contrib/,$(CONTRIB_LIBS)) +REQUIRED := $(CONTRIB_MOD) $(REQUIRED) REQUIRED_DIR = $(patsubst %,$(MODDIR)/%,$(REQUIRED)) REQUIRED_DONE = $(patsubst %,%/all.done,$(REQUIRED_DIR)) @@ -192,7 +193,7 @@ RM = rm AR = ar ifneq ($(wildcard $(MODDIR)/devutil/scripts),) -MOD_SCRIPT_DIR = $(MODDIR)/devutil/scripts +MOD_SCRIPT_DIR = $(MODDIR)/bin else MOD_SCRIPT_DIR = $(MODDIR)/bin endif diff --git a/make/header.mk b/make/header.mk index 0e41d2d0..5c955c12 100644 --- a/make/header.mk +++ b/make/header.mk @@ -4,7 +4,7 @@ # $Id$ include $(MODDIR)/make/defs.mk -ALL += $(LIBDIR) $(PREREQ_DONE) $(INST_HDRS) +ALL += $(LIBDIR) $(PREREQ_DONE) $(LOCAL_HDR) include $(MODDIR)/make/rules.mk clean: objclean textclean localclean install: $(ALL) diff --git a/make/rules.mk b/make/rules.mk index 3cf1d631..9102b753 100644 --- a/make/rules.mk +++ b/make/rules.mk @@ -46,6 +46,9 @@ $(TOPDIR)/include: $(TOPDIR)/include/%.h: %.h mkdir -p $(dir $@); cp $(@F) $@ +$(TOPDIR)/bin/%.sh: %.sh + mkdir -p $(dir $@); cp $(@F) $@ + %.o: %.cpp $(CPP) $(CPPFLAGS) -c $< diff --git a/make/scripts.mk b/make/scripts.mk index 3a96cda1..08004883 100644 --- a/make/scripts.mk +++ b/make/scripts.mk @@ -3,7 +3,7 @@ # contact@jannet.de # $Id$ -ALL += $(SCRIPTS) +ALL += $(SCRIPTS) $(LOCAL_EXE_SH) include $(MODDIR)/make/defs.mk include $(MODDIR)/make/rules.mk clean:allclean localclean doneclean textclean diff --git a/make/tools.mk b/make/tools.mk index 8b34fb84..48658af7 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -4,7 +4,7 @@ # $Id$ include $(MODDIR)/make/defs.mk -ALL += $(LIBDIR) $(PREREQ_DONE) $(INST_HDRS) $(MEMBERS) +ALL += $(LIBDIR) $(PREREQ_DONE) $(LOCAL_HDR) $(LOCAL_EXE_SH) $(MEMBERS) include $(MODDIR)/make/rules.mk clean: objclean textclean localclean install: $(ALL) diff --git a/scripts/Makefile b/scripts/Makefile index e6c52692..8dec072a 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -38,8 +38,8 @@ include $(MODDIR)/make/scripts.mk all: -$(INSTALL_BINDIR): - $(INSTALL) -o root -g root -m 755 -d $@ +#$(INSTALL_BINDIR): +# $(INSTALL) -o root -g root -m 755 -d $@ #install: $(EXEDIR) $(CONFDIR) # $(INSTALL) *.sh -m 755 $(EXEDIR)/ @@ -48,6 +48,6 @@ $(INSTALL_BINDIR): #clean distclean libclean: # rm -rf *~ .*.swp core *.rep -install: $(INSTALL_BINDIR) $(INSTALLED_EXE_SH) +install: all $(INSTALL_BINDIR) $(INSTALLED_EXE_SH) profclean: