summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/skin_parser/Makefile27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/skin_parser/Makefile b/lib/skin_parser/Makefile
index 08b7fa14d3..c4dd57dcac 100644
--- a/lib/skin_parser/Makefile
+++ b/lib/skin_parser/Makefile
@@ -15,9 +15,18 @@ AR ?= ar
OUTPUT=libskin_parser
TARGET_DIR ?= ./
+ifeq ($(OS),Windows_NT)
+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
+
+CPPDEFINES := $(shell echo foo | $(CC) -dM -E -)
+
# construct build directory if BUILDDIR is not set.
BUILDDIR ?= $(TARGET_DIR)build
-TARGETPLATFORM ?= $(shell uname)
CFLAGS += -D__PCTOOL__
ifdef RBARCH
@@ -34,20 +43,20 @@ OBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(SOURCES)))
all: $(OUTPUT).a
$(OBJDIR)%.o: %.c
- @echo CC $<
- $(SILENT)mkdir -p $(dir $@)
+ $(info CC $<)
+ $(SILENT)$(call mkdir,$(dir $@))
$(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
ifeq ($(findstring Darwin,$(TARGETPLATFORM)),Darwin)
# some trickery to build ppc and i386 from a single call
$(OUTPUT).a: $(TARGET_DIR)$(OUTPUT)i386.a $(TARGET_DIR)$(OUTPUT)ppc.a
- @echo lipo $(TARGET_DIR)$@
- $(SILENT) rm -f $(TARGET_DIR)$(OUTPUT)
+ $(info lipo $(TARGET_DIR)$@)
+ $(SILENT)$(call rm,$(TARGET_DIR)$(OUTPUT))
$(SILENT)lipo -create $(TARGET_DIR)$(OUTPUT)ppc.a $(TARGET_DIR)$(OUTPUT)i386.a -output $(TARGET_DIR)$(OUTPUT).a
ifneq ($(RBARCH),)
$(OUTPUT)$(RBARCH).a: $(OBJS)
- @echo AR $@
+ $(info AR $@)
$(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
else
$(TARGET_DIR)$(OUTPUT)i386.a:
@@ -58,12 +67,10 @@ $(TARGET_DIR)$(OUTPUT)ppc.a:
endif
else
$(OUTPUT).a: $(OBJS)
- @echo AR $@
+ $(info AR $@)
$(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
endif
clean:
- rm -f $(OBJS) $(OUTPUT) $(TARGET_DIR)$(OUTPUT)*.a
-ifeq ($(findstring Darwin,$(shell uname)),Darwin)
-endif
+ $(call rm,$(OBJS) $(OUTPUT) $(TARGET_DIR)$(OUTPUT)*.a)