diff --git a/Makefile b/Makefile index a66836e..5b4c50b 100755 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ endif # Binaries-specific targets # #******************************************************************************# # Make the binaries. - all-bins: $(CHECKCFG) $(DEFAULT_BINARIES:%=all-%) + all-bins: $(CHECKCFG) $(BINARIES:%=all-%) # Make a binary object directory. $(BINARIES:%=$(OBJDIR)/%): @@ -190,7 +190,7 @@ $(foreach bin,$(BINARIES),\ $(eval $(call make-installbinary-rule,$(bin)))) # Install binaries - install-bins: $(DEFAULT_BINARIES:%=install-%) + install-bins: $(BINARIES:%=install-%) # Uninstall binaries uninstall-bins: $(BINARIES:%=uninstall-%) diff --git a/Makefile.vars b/Makefile.vars index 6c26965..516e6bf 100755 --- a/Makefile.vars +++ b/Makefile.vars @@ -95,9 +95,6 @@ endif #******************************************************************************# # Binaries and sources # #******************************************************************************# -# Look for binaries - BINARIES := $(notdir $(shell find $(SRCDIR) -mindepth 1 -maxdepth 1 \ - -type d | sort)) # Get their libs define get-binary-libs @@ -108,10 +105,6 @@ endef $(foreach bin,$(BINARIES), \ $(eval $(call get-binary-libs,$(bin)))) -# Get the default binaries - DEFAULT_BINARIES := $(foreach bin,$(BINARIES), \ - $(if $(DISABLE_$(bin)),,$(bin))) - # Look for their sources define get-binary-sources SRC_$1 := $(basename $(shell find $(SRCDIR)/$1 \ diff --git a/configure b/configure index c24db40..e3848a0 100755 --- a/configure +++ b/configure @@ -17,6 +17,10 @@ target= windows= default_zoom=8 default_storage=fls0 +BUILD_p7=1 +BUILD_p7screen=1 +BUILD_p7os=0 +BUILD_mcsfile=0 # Installation directories root='' @@ -27,6 +31,20 @@ mandir='${prefix}/share/man' # Installation options install_manpages=yes +# +# Tool name checking +# +check() +{ + if [ $1 = "p7" ] || + [ $1 = "p7screen" ] || + [ $1 = "p7os" ] || + [ $1 = "mcsfile" ]; then + return 1 # true if there is a tool + fi + return 0 # false if not a tool +} + #******************************************************************************# # Help message # #******************************************************************************# @@ -47,6 +65,14 @@ Build options: --target=TARGET the build target [$target] --default-zoom=ZOOM the default zoom for \`p7screen\` [$default_zoom] --default-storage=STOR the default storage device [$default_storage] + --enable- build and install the selected tool + --disable- do not build or install the selected tool + +Tools: + p7 enabled (default) + p7screen enabled (default) + p7os disabled (default) + mcsfile disabled (default) Installation options: --noinstall-manpages do not install manpages @@ -121,6 +147,22 @@ for arg ; do case "$arg" in --prefix=*) prefix="${arg#*=}" ;; --bindir=*) bindir="${arg#*=}" ;; --mandir=*) mandir="${arg#*=}" ;; +--enable-*) + tool="${arg#--enable-}" + if check $tool; then + echo "error: connot enable $tool: unknown tool" + exit 1 + fi + + eval BUILD_$tool=1;; +--disable-*) + tool="${arg#--disable-}" + if check $tool; then + echo "error: connot disable $tool: unknown tool" + exit 1 + fi + + eval BUILD_$tool=0;; *) echo "$arg: didn't read" ;; esac; done @@ -152,34 +194,54 @@ done # Clean before. make mrproper MAKE_FULL_LOG=y 1>/dev/null 2>/dev/null -# Do it! -exec 3>&1 1>Makefile.cfg -cat <&3 3>&- +" +} + +gen | tee Makefile.cfg chmod +x Makefile.cfg #******************************************************************************# diff --git a/src/mcsfile/vars.mk b/src/mcsfile/vars.mk index b9df833..8b5f290 100755 --- a/src/mcsfile/vars.mk +++ b/src/mcsfile/vars.mk @@ -1,4 +1,3 @@ #!/usr/bin/make -f -disable: libs: @echo libg1m diff --git a/src/p7os/vars.mk b/src/p7os/vars.mk index 3cc5551..c22ee31 100755 --- a/src/p7os/vars.mk +++ b/src/p7os/vars.mk @@ -1,4 +1,3 @@ #!/usr/bin/make -f -disable: libs: @echo libp7