Skip to content

Commit debb5b1

Browse files
committed
Makefiles: new targets to build & install just software or just docs
This is mostly to help the debian packaging build just the architecture-dependent parts (the software, via `dpkg-buildpackage -B`) or just the architecture-independent parts (the docs, via `dpkg-buildpackage -A`).
1 parent 3a490c1 commit debb5b1

2 files changed

Lines changed: 33 additions & 14 deletions

File tree

docs/src/Submakefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ MAN_SRCS = $(sort \
2828
./config.status --file=$@:$<
2929

3030
ifneq ($(MANDB),)
31-
default: $(DOC_DIR)/man/index.db
31+
docs: $(DOC_DIR)/man/index.db
3232
$(DOC_DIR)/man/index.db: $(MAN_SRCS)
3333
@echo "Updating 'whatis' database"
3434
$(Q)$(MANDB) $(DOC_DIR)/man
@@ -722,7 +722,6 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_ZH_CN_SMALL)): $(DOC_SRCDIR)/%
722722
-a stylesheet=linuxcnc.css \
723723
-d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
724724

725-
default: docs
726725
$(DOC_DIR)/html/de/xref.html: objects/xref_de.xml $(DOC_SRCDIR)/xref.xsl $(DOC_SRCDIR)/docs.xml $(DOC_SRCDIR)/terms.xml
727726
$(ECHO) Converting $< to HTML
728727
@xsltproc --stringparam docname "xref_de" --stringparam language spanish --path objects -o $@ $(DOC_SRCDIR)/xref.xsl $<
@@ -756,7 +755,6 @@ install-doc-pdf:
756755
install-doc-html:
757756
$(DIR) $(DESTDIR)$(docsdir)
758757
cp -a $(DOC_DIR)/html $(DESTDIR)$(docsdir)
759-
install-kernel-indep: install-doc
760758

761759
docclean:
762760
-rm -f $(DOC_DIR)/LinuxCNC_Getting_Started.pdf

src/Makefile

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
# Some useful targets:
2+
#
3+
# default (if no make target is specified): Build the software and
4+
# the docs (if enabled via configure).
5+
#
6+
# build-software: Build all the realtime and non-realtime software
7+
# libraries & executables.
8+
#
9+
# docs: Build all the documentation that's enabled through configure.
10+
#
11+
#
12+
# install: Install everything (realtime software, non-realtime
13+
# software, and docs).
14+
#
15+
# install-software: Install all architecture-specific things (realtime
16+
# and non-realtime libraries and executables).
17+
#
18+
# install-docs: Install all enabled documentation into $(DESTDIR).
19+
#
20+
21+
22+
default: build-software
23+
24+
install: install-software install-docs
25+
26+
install-software: install-kernel-dep install-kernel-indep install-menu
27+
28+
129
# buster gcc (Debian 8.3.0-6) emits many warnings
230
# use at your own risk
331
ifeq ($(origin SUPPRESS_WARNINGS), undefined)
@@ -32,7 +60,7 @@ endif
3260

3361
# Delete the default suffix rules
3462
.SUFFIXES:
35-
.PHONY: default userspace modules clean modclean depclean install python pythonclean cscope cscopeclean
63+
.PHONY: default build-software userspace modules clean modclean depclean install install-software install-docs python pythonclean cscope cscopeclean
3664

3765
# A "trivial build" is one which should not include dependency information
3866
# either because it should be usable before dependency information can be
@@ -113,7 +141,7 @@ cxx-option = $(shell if $(CXX) $(CXXFLAGS) $(1) -S -o /dev/null -xc++ /dev/null
113141
ifeq ($(origin KERNELRELEASE),undefined)
114142
# When KERNELRELEASE is not defined, this is the userspace build.
115143
# The "modules" target is the gateway to the kernel module build.
116-
default: userspace modules
144+
build-software: userspace modules
117145
ifeq ($(RUN_IN_PLACE),yes)
118146
ifneq ($(BUILD_SYS),uspace)
119147
@if [ -f ../bin/linuxcnc_module_helper ]; then if ! [ `id -u` = 0 -a -O ../bin/linuxcnc_module_helper -a -u ../bin/linuxcnc_module_helper ]; then $(VECHO) "You now need to run 'sudo make setuid' in order to run in place."; fi; fi
@@ -310,7 +338,7 @@ INFILES = \
310338
$(INFILES): %: %.in config.status
311339
@./config.status --file=$@
312340

313-
default: $(INFILES)
341+
build-software: $(INFILES)
314342

315343
# For each file to be copied to ../include, its location in the source tree
316344
# is listed here. Note that due to $(INCLUDE), defined above, the include
@@ -607,7 +635,7 @@ You configured run-in-place, but are trying to install.
607635
For an installable version, run configure without --enable-run-in-place
608636
and rebuild
609637
endef
610-
install:
638+
install install-software install-docs:
611639
$(error $(ERROR_MESSAGE))
612640

613641
MENUS = ../share/menus/CNC.menu \
@@ -626,13 +654,6 @@ NC_FILES=$(filter-out %/butterfly.ngc,$(call GLOB,../nc_files/*))
626654
TCL=$(call GLOB,../tcl/*.tcl)
627655
TCL_BIN=$(call GLOB,../tcl/bin/*.tcl) ../tcl/bin/popimage
628656

629-
install:
630-
$(MAKE) install-docs || echo "Ignored."
631-
$(MAKE) install-kernel-dep || echo "Ignored."
632-
$(MAKE) install-kernel-indep || echo "Ignored."
633-
$(MAKE) install-menu
634-
$(ECHO) "Installed in DESTDIR='$(DESTDIR)' with prefix $(prefix)"
635-
636657
install-docs:
637658
$(DIR) $(DESTDIR)$(docsdir)
638659
$(FILE) $(addprefix ../docs/,$(DOCS)) $(DESTDIR)$(docsdir)

0 commit comments

Comments
 (0)