2010-06-17 06:52:02 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
#
|
|
|
|
|
2010-06-22 16:51:29 +00:00
|
|
|
ifndef V
|
|
|
|
SILENT = @
|
|
|
|
endif
|
2010-06-17 06:52:02 +00:00
|
|
|
|
2010-07-06 21:08:16 +00:00
|
|
|
CC ?= gcc
|
2010-07-21 19:35:16 +00:00
|
|
|
AR ?= ar
|
2010-07-06 21:08:16 +00:00
|
|
|
OUTPUT=libskin_parser
|
|
|
|
TARGET_DIR ?= ./
|
2010-06-17 06:52:02 +00:00
|
|
|
|
2020-09-04 17:10:15 +00:00
|
|
|
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 -)
|
|
|
|
|
2010-07-06 21:08:16 +00:00
|
|
|
# construct build directory if BUILDDIR is not set.
|
|
|
|
BUILDDIR ?= $(TARGET_DIR)build
|
2010-06-17 06:52:02 +00:00
|
|
|
|
2013-02-08 21:36:23 +00:00
|
|
|
CFLAGS += -D__PCTOOL__
|
2010-07-06 21:08:16 +00:00
|
|
|
ifdef RBARCH
|
|
|
|
CFLAGS += -arch $(RBARCH)
|
|
|
|
OBJDIR = $(BUILDDIR)/$(RBARCH)/
|
|
|
|
else
|
|
|
|
OBJDIR = $(BUILDDIR)/
|
|
|
|
endif
|
|
|
|
|
|
|
|
# input files
|
|
|
|
SOURCES := skin_buffer.c skin_debug.c skin_parser.c skin_scan.c tag_table.c
|
|
|
|
OBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(SOURCES)))
|
|
|
|
|
|
|
|
all: $(OUTPUT).a
|
|
|
|
|
|
|
|
$(OBJDIR)%.o: %.c
|
2020-09-04 17:10:15 +00:00
|
|
|
$(info CC $<)
|
|
|
|
$(SILENT)$(call mkdir,$(dir $@))
|
2010-07-06 21:08:16 +00:00
|
|
|
$(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
2011-03-05 12:50:46 +00:00
|
|
|
ifeq ($(findstring Darwin,$(TARGETPLATFORM)),Darwin)
|
2010-07-06 21:08:16 +00:00
|
|
|
# some trickery to build ppc and i386 from a single call
|
|
|
|
$(OUTPUT).a: $(TARGET_DIR)$(OUTPUT)i386.a $(TARGET_DIR)$(OUTPUT)ppc.a
|
2020-09-04 17:10:15 +00:00
|
|
|
$(info lipo $(TARGET_DIR)$@)
|
|
|
|
$(SILENT)$(call rm,$(TARGET_DIR)$(OUTPUT))
|
2010-07-06 21:08:16 +00:00
|
|
|
$(SILENT)lipo -create $(TARGET_DIR)$(OUTPUT)ppc.a $(TARGET_DIR)$(OUTPUT)i386.a -output $(TARGET_DIR)$(OUTPUT).a
|
2010-06-17 06:52:02 +00:00
|
|
|
|
2010-07-06 21:08:16 +00:00
|
|
|
ifneq ($(RBARCH),)
|
|
|
|
$(OUTPUT)$(RBARCH).a: $(OBJS)
|
2020-09-04 17:10:15 +00:00
|
|
|
$(info AR $@)
|
2010-07-06 21:08:16 +00:00
|
|
|
$(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
|
|
|
|
else
|
|
|
|
$(TARGET_DIR)$(OUTPUT)i386.a:
|
|
|
|
make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) $(OUTPUT)i386.a
|
|
|
|
|
|
|
|
$(TARGET_DIR)$(OUTPUT)ppc.a:
|
|
|
|
make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) $(OUTPUT)ppc.a
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
$(OUTPUT).a: $(OBJS)
|
2020-09-04 17:10:15 +00:00
|
|
|
$(info AR $@)
|
2010-07-06 21:08:16 +00:00
|
|
|
$(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
|
|
|
|
endif
|
2010-06-17 06:52:02 +00:00
|
|
|
|
|
|
|
clean:
|
2020-09-04 17:10:15 +00:00
|
|
|
$(call rm,$(OBJS) $(OUTPUT) $(TARGET_DIR)$(OUTPUT)*.a)
|
2010-07-06 21:08:16 +00:00
|
|
|
|