Skip to content

Commit 50d8816

Browse files
vriesdavidmalcolm
authored andcommitted
Makefile: Fix submake in seperate build dir
The gcc-c-api submake fails in a seperate build dir for two reasons: - it cannot find the gcc-c-api dir - it cannot find the gcc-c-api Makefile Fix this by creating the gcc-c-api dir in the build dir, and indicating the Makefile location using -f.
1 parent f0cec20 commit 50d8816

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,11 @@ $(PLUGIN_DSO): $(PLUGIN_OBJECT_FILES) $(LIBGCC_C_API_SO)
154154
$(LIBS) \
155155
-lgcc-c-api -Lgcc-c-api -Wl,-rpath=$(GCCPLUGINS_DIR)
156156

157-
$(LIBGCC_C_API_SO):
158-
cd gcc-c-api && make libgcc-c-api.so CC=$(CC) $(if $(srcdir),srcdir=$(srcdir)./gcc-c-api/)
157+
$(pwd)/gcc-c-api:
158+
mkdir -p $@
159+
160+
$(LIBGCC_C_API_SO): $(pwd)/gcc-c-api
161+
cd gcc-c-api && make $(if $(srcdir),-f $(srcdir)./gcc-c-api/Makefile) libgcc-c-api.so CC=$(CC) $(if $(srcdir),srcdir=$(srcdir)./gcc-c-api/)
159162

160163
$(PLUGIN_OBJECT_GENERATED_FILES): CPPFLAGS+= $(if $(srcdir),-I$(srcdir))
161164

0 commit comments

Comments
 (0)