summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-05-11 17:22:44 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-05-11 20:34:12 +0200
commit4f3fa9accbd77f8c85f87ae057d2420ce7666ff7 (patch)
tree8fced5134d1d2fea634ab93063cf3647df632efc /rbutil
parent8a4075d454a64cc51ea7e496f346fd96d5970eff (diff)
downloadrockbox-4f3fa9accbd77f8c85f87ae057d2420ce7666ff7.tar.gz
rockbox-4f3fa9accbd77f8c85f87ae057d2420ce7666ff7.tar.bz2
rockbox-4f3fa9accbd77f8c85f87ae057d2420ce7666ff7.zip
Change mkdir -p to work on Windows.
Windows mkdir doesn't know about the -p option and requires paths to use \ as path separator. Try to detect when building on Windows and use the Windows internal function instead of relying on a compatible mkdir in the path. Change-Id: I47d47d45edeb38c672321f77d6e91268bf744dba
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/libtools.make15
1 files changed, 10 insertions, 5 deletions
diff --git a/rbutil/libtools.make b/rbutil/libtools.make
index 2e3cc6f1e2..054a1c2c5a 100644
--- a/rbutil/libtools.make
+++ b/rbutil/libtools.make
@@ -21,6 +21,11 @@ endif
# Get directory this Makefile is in for relative paths.
TOP := $(dir $(lastword $(MAKEFILE_LIST)))
+ifeq ($(OS),Windows_NT)
+mkdir = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
+else
+mkdir = mkdir -p $(1)
+endif
# overwrite for releases
APPVERSION ?= $(shell $(TOP)/../tools/version.sh $(TOP)/..)
@@ -93,7 +98,7 @@ $(OBJDIR)$(LIBUCL):
# building the standalone executable
$(BINARY): $(OBJS) $(EXTRADEPS) $(addprefix $(OBJDIR),$(EXTRALIBOBJS))
@echo LD $@
-# $(SILENT)mkdir -p $(dir $@)
+ $(SILENT)$(call mkdir,$(dir $@))
# EXTRADEPS need to be built into OBJDIR.
$(SILENT)$(CROSS)$(CC) $(CFLAGS) $(LDOPTS) -o $(BINARY) \
$(OBJS) $(addprefix $(OBJDIR),$(EXTRADEPS)) \
@@ -102,7 +107,7 @@ $(BINARY): $(OBJS) $(EXTRADEPS) $(addprefix $(OBJDIR),$(EXTRALIBOBJS))
# common rules
$(OBJDIR)%.o:
@echo CC $<
- $(SILENT)mkdir -p $(dir $@)
+ $(SILENT)$(call mkdir,$(dir $@))
$(SILENT)$(CROSS)$(CC) $(CFLAGS) -c -o $@ $<
# lib rules
@@ -116,14 +121,14 @@ dll: $(OUTPUT).dll
$(OUTPUT).dll: $(TARGET_DIR)$(OUTPUT).dll
$(TARGET_DIR)$(OUTPUT).dll: $(LIBOBJS) $(addprefix $(OBJDIR),$(EXTRALIBOBJS))
@echo DLL $(notdir $@)
- $(SILENT)mkdir -p $(dir $@)
+ $(SILENT)$(call mkdir,$(dir $@))
$(SILENT)$(CROSS)$(CC) $(CFLAGS) -shared -o $@ $^ \
-Wl,--output-def,$(TARGET_DIR)$(OUTPUT).def
# create lib file from objects
$(TARGET_DIR)lib$(OUTPUT)$(RBARCH).a: $(LIBOBJS) $(addprefix $(OBJDIR),$(EXTRALIBOBJS))
@echo AR $(notdir $@)
- $(SILENT)mkdir -p $(dir $@)
+ $(SILENT)$(call mkdir,$(dir $@))
$(SILENT)$(AR) rcs $@ $^
clean:
@@ -138,6 +143,6 @@ $(BIN2C):
# OS X specifics
$(OUTPUT).dmg: $(OUTPUT)
@echo DMG $@
- $(SILENT)mkdir -p $(OUTPUT)-dmg
+ $(SILENT)$(call mkdir,$(OUTPUT)-dmg))
$(SILENT)cp -p $(OUTPUT) $(OUTPUT)-dmg
$(SILENT)hdiutil create -srcfolder $(OUTPUT)-dmg $@