1
0
Fork 0
forked from len0rd/rockbox
foxbox/tools/ucl/src/Makefile
Dominik Riebeling c7c657ca92 Prevent unnecessary rebuilding of libs.
- When building for Rockbox Utility the called Makefiles would rebuild the libs
  every time. Change dependencies a bit to allow make to properly detect if the
  lib is already up to date.
- Remove dependency on output folder in some cases to avoid unnecessary
  rebuilds.
- Add standard Rockbox header to files lacking it.
- Make make calls from qmake silent.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30608 a1c6a512-1295-4272-9138-f99709370657
2011-09-26 20:51:23 +00:00

60 lines
1.7 KiB
Makefile

# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
CFLAGS = -I../include
ifndef V
SILENT = @
endif
ifdef RBARCH
CFLAGS += -arch $(RBARCH)
endif
TARGET_DIR ?= $(shell pwd)
OBJDIR = $(TARGET_DIR)build$(RBARCH)
SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \
n2d_d.c n2d_ds.c n2d_to.c n2e_99.c n2e_d.c n2e_ds.c n2e_to.c ucl_crc.c \
ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c #ucl_dll.c
OBJS = $(addprefix $(OBJDIR)/,$(SOURCES:%.c=%.o))
# This Makefile is _not_ used to build uclpack for Rockbox builds anymore (they
# use tools.make), so we can use $(CC) and $(AR) here.
libucl$(RBARCH).a: $(TARGET_DIR)libucl$(RBARCH).a
$(TARGET_DIR)libucl$(RBARCH).a: $(OBJS)
@echo AR $(notdir $@)
$(SILENT)$(AR) rucs $@ $(OBJS) >/dev/null 2>&1
$(OBJDIR)/%.o: %.c
@echo CC $<
$(SILENT)mkdir -p $(dir $@)
$(SILENT)$(CC) $(CFLAGS) -c $< -o $@
# some trickery to build ppc and i386 from a single call
ifeq ($(RBARCH),)
$(TARGET_DIR)libucli386.a:
make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libucli386.a
$(TARGET_DIR)libuclppc.a:
make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libuclppc.a
endif
libucl-universal: $(TARGET_DIR)libucli386.a $(TARGET_DIR)libuclppc.a
@echo lipo $(TARGET_DIR)libucl.a
$(SILENT) rm -f $(TARGET_DIR)libucl.a
$(SILENT)lipo -create $(TARGET_DIR)libuclppc.a $(TARGET_DIR)libucli386.a -output $(TARGET_DIR)libucl.a
clean:
rm -f $(TARGET_DIR)libucl*.a
rm -rf build*