From ea3b48afeba5113935426f27856cfe0bc9ccf729 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Mon, 26 Sep 2022 10:47:18 -0400 Subject: [PATCH 1/4] build(makefile): explicit DEFAULT_GOAL --- doc/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 5a4746e4..4ecfe0cb 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,12 +1,13 @@ # Minimal makefile for Sphinx documentation +.DEFAULT_GOAL := help + # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build SOURCEDIR = . BUILDDIR = _build -# Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) From f3b9536c895e3d547d5b01287d38df545a0f8f61 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Mon, 26 Sep 2022 10:48:00 -0400 Subject: [PATCH 2/4] build(makefile): .PHONY targets are cumulative --- doc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 4ecfe0cb..fd1f1b72 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -8,12 +8,12 @@ SPHINXBUILD = sphinx-build SOURCEDIR = . BUILDDIR = _build +.PHONY: help help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: help Makefile - # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +.PHONY: Makefile %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) From 0ca12b31712489534e2d4e4f6c3f69f600fe8229 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Mon, 26 Sep 2022 10:48:38 -0400 Subject: [PATCH 3/4] build(makefile): added proper .PHONY target --- sample/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sample/Makefile b/sample/Makefile index c6ca7568..d51b1545 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -4,6 +4,7 @@ COMMON=-O2 -I../include -L../lib -std=c++17 -pthread -Wl,-no-as-needed -Wl,-rpath,'$$ORIGIN'/../lib +.PHONY: all all: $(CXX) $(COMMON) testxml.cc -lmujoco -o ../bin/testxml $(CXX) $(COMMON) testspeed.cc -lmujoco -o ../bin/testspeed From f637dd76d5485cbcfe4d2e5b000915243846de73 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Mon, 26 Sep 2022 10:49:08 -0400 Subject: [PATCH 4/4] build(makefile): added proper .PHONY target --- sample/Makefile.macos | 1 + sample/Makefile.windows | 1 + 2 files changed, 2 insertions(+) diff --git a/sample/Makefile.macos b/sample/Makefile.macos index ba5b6093..b9f4e594 100644 --- a/sample/Makefile.macos +++ b/sample/Makefile.macos @@ -10,6 +10,7 @@ CFLAGS=-O2 -F$(MUJOCOPATH) -I$(GLFWROOT)/include -pthread CXXFLAGS=$(CFLAGS) -std=c++17 -stdlib=libc++ ALLFLAGS=$(CXXFLAGS) -L$(GLFWROOT)/lib -Wl,-rpath,$(MUJOCOPATH) +.PHONY: all all: clang++ $(ALLFLAGS) testxml.cc -framework mujoco -o testxml clang++ $(ALLFLAGS) testspeed.cc -framework mujoco -o testspeed diff --git a/sample/Makefile.windows b/sample/Makefile.windows index 6bbc028a..c6ba0fae 100644 --- a/sample/Makefile.windows +++ b/sample/Makefile.windows @@ -8,6 +8,7 @@ COMMON=/O2 /MT /EHsc /arch:AVX /I../include /Fe../bin/ +.PHONY: all all: cl $(COMMON) testxml.cc ../lib/mujoco.lib cl $(COMMON) testspeed.cc ../lib/mujoco.lib