rbutil: Fix native Windows build for tools.

- When make on Windows finds sh.exe it will try to use that. We use
  cmd.exe calls when detecting Windows, so make sure we use cmd.exe as
  shell.
- Add missing Windows compatibility to tomcrypt Makefile.

Change-Id: Iaef133ca27472a5ddf449174d540983f15c66aea
This commit is contained in:
Dominik Riebeling 2020-10-21 19:12:08 +02:00
parent 884d8922e3
commit 1801dcc999
4 changed files with 14 additions and 2 deletions

View file

@ -22,6 +22,7 @@ endif
# Get directory this Makefile is in for relative paths.
TOP := $(dir $(lastword $(MAKEFILE_LIST)))
ifeq ($(OS),Windows_NT)
SHELL = cmd.exe
mkdir = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
rm = if exist $(subst /,\,$(1)) del /q /s $(subst /,\,$(1))
else

View file

@ -12,6 +12,7 @@ SILENT = @
endif
ifeq ($(OS),Windows_NT)
SHELL = cmd.exe
mkdir = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
rm = if exist $(subst /,\,$(1)) del /q /s $(subst /,\,$(1))
else

View file

@ -13,6 +13,7 @@ SILENT = @
endif
ifeq ($(OS),Windows_NT)
SHELL = cmd.exe
mkdir = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
else
mkdir = mkdir -p $(1)

View file

@ -13,6 +13,15 @@ ifndef V
SILENT := @
endif
ifeq ($(OS),Windows_NT)
SHELL = cmd.exe
mkdir = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
rm = if exist $(subst /,\,$(1)) del /q /s $(subst /,\,$(1))
else
mkdir = mkdir -p $(1)
rm = rm -rf $(1)
endif
CFLAGS := -O3 -g -std=c99 -Wall $(DEFINES) -Isrc/headers
LDFLAGS :=
@ -38,8 +47,8 @@ $(LIB): $(OBJS)
$(BUILD_DIR)/%.o: %.c
$(info CC $(notdir $@))
$(SILENT)mkdir -p $(dir $@)
$(SILENT)$(call mkdir, $(dir $@))
$(SILENT)$(CROSS)$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -fr $(BUILDDIR) $(LIB)
$(call rm,$(BUILDDIR) $(LIB))