Skip to content

Commit c4af0a9

Browse files
author
Kevin Pyle
committed
Use $(MAKE) and -C when running sub-make processes
Use $(MAKE) to run the same make even when it is not named 'make' or is not first on the path. Use -C for simplicity, since the Makefile already relies on GNU make extensions.
1 parent 21c00c0 commit c4af0a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ $(PLUGIN_DSO): $(PLUGIN_OBJECT_FILES) $(LIBGCC_C_API_SO)
151151
-lgcc-c-api -Lgcc-c-api -Wl,-rpath=$(GCCPLUGINS_DIR)
152152

153153
$(LIBGCC_C_API_SO):
154-
cd gcc-c-api && make libgcc-c-api.so CC="$(CC)" TARGET_GCC="$(TARGET_GCC)"
154+
$(MAKE) -C gcc-c-api libgcc-c-api.so CC="$(CC)" TARGET_GCC="$(TARGET_GCC)"
155155

156156
$(PLUGIN_OBJECT_GENERATED_FILES): CPPFLAGS+= $(if $(srcdir),-I$(srcdir))
157157

@@ -172,7 +172,7 @@ clean:
172172
$(RM) -r docs/_build
173173
$(RM) -f gcc-with-$(PLUGIN_NAME).1 gcc-with-$(PLUGIN_NAME).1.gz
174174
$(RM) -f print-gcc-version
175-
cd gcc-c-api && make clean CC="$(CC)" TARGET_GCC="$(TARGET_GCC)"
175+
$(MAKE) -C gcc-c-api clean CC="$(CC)" TARGET_GCC="$(TARGET_GCC)"
176176
find tests -name "*.o" -delete
177177

178178
autogenerated-config.h: $(addprefix $(srcdir),generate-config-h.py configbuilder.py)
@@ -205,7 +205,7 @@ mandir=/usr/share/man
205205
UpperPluginName = $(shell $(PYTHON) -c"print('$(PLUGIN_NAME)'.upper())")
206206

207207
docs/_build/man/gcc-with-python.1: docs/gcc-with-python.rst
208-
cd docs && $(MAKE) man
208+
$(MAKE) -C docs man
209209

210210
gcc-with-$(PLUGIN_NAME).1: docs/_build/man/gcc-with-python.1
211211
# Fixup the generic manpage for this build:
@@ -224,7 +224,7 @@ man: gcc-with-$(PLUGIN_NAME).1.gz
224224
install: $(PLUGIN_DSO) gcc-with-$(PLUGIN_NAME).1.gz
225225
mkdir -p $(DESTDIR)$(GCCPLUGINS_DIR)
226226

227-
cd gcc-c-api && $(MAKE) install
227+
$(MAKE) -C gcc-c-api install
228228

229229
cp $(PLUGIN_DSO) $(DESTDIR)$(GCCPLUGINS_DIR)
230230

@@ -290,7 +290,7 @@ show-ssa: plugin
290290
$(INVOCATION_ENV_VARS) $(srcdir)./gcc-with-python examples/show-ssa.py test.c
291291

292292
html: docs/tables-of-passes.rst docs/passes.svg
293-
cd docs && $(MAKE) html
293+
$(MAKE) -C docs $@
294294

295295
# We commit this generated file to SCM to allow the docs to be built without
296296
# needing to build the plugin:

0 commit comments

Comments
 (0)