about summary refs log tree commit diff
path: root/programs.mk
diff options
context:
space:
mode:
Diffstat (limited to 'programs.mk')
-rw-r--r--programs.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/programs.mk b/programs.mk
index 74f2982a5f1c..218fd37a3fa4 100644
--- a/programs.mk
+++ b/programs.mk
@@ -22,7 +22,9 @@ define build-program
   _libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_PATH))
   $(1)_PATH := $$(_d)/$(1)
 
-  $$($(1)_PATH): $$($(1)_OBJS) $$(_libs)
+  $$(eval $$(call create-dir,$$(_d)))
+
+  $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) | $$(_d)
 	$$(trace-ld) $(CXX) -o $$@ $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
 
   $(1)_INSTALL_DIR ?= $$(bindir)