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
This commit is contained in:
Dominik Riebeling 2013-05-11 17:22:44 +02:00
parent 8a4075d454
commit 4f3fa9accb
3 changed files with 24 additions and 7 deletions

View file

@ -12,6 +12,12 @@ ifndef V
SILENT = @
endif
ifeq ($(OS),Windows_NT)
mkdir = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
else
mkdir = mkdir -p $(1)
endif
ifdef RBARCH
CFLAGS += -arch $(RBARCH)
endif
@ -59,7 +65,7 @@ $(TARGET_DIR)libucl$(RBARCH).a: $(OBJS)
$(OBJDIR)/%.o: %.c
@echo CC $<
$(SILENT)mkdir -p $(dir $@)
$(SILENT)$(call mkdir, $(dir $@))
$(SILENT)$(CROSS)$(CC) $(CFLAGS) -c $< -o $@
clean: