+
+Add default libpayload build, xcompile, and lpgcc setup to tint.
+
+Signed-off-by: Marc Jones <marc.jones@gmail.com>
+
+diff -rupN tintorig/Makefile tint/Makefile
+--- tintorig/Makefile 2005-07-17 05:30:54.000000000 -0600
++++ tint/Makefile 2010-08-23 18:06:24.671875000 -0600
+@@ -28,6 +28,65 @@
+ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
++$(if $(wildcard .xcompile),,$(eval $(shell bash ./xcompile.sh &> .xcompile)))
++include .xcompile
++
++LIBCONFIG_PATH := ../libpayload
++LIBPAYLOAD_DIR := ./libpayloadbin
++LPCC := $(LIBPAYLOAD_DIR)/libpayload/bin/lpgcc
++LPAS := $(LIBPAYLOAD_DIR)/libpayload/bin/lpas
++HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD_DIR)/libpayload/lib/libpayload.a)
++LIB_CONFIG ?= defconfig
++
++# CFLAGS := -Wall -Werror -Os
++CFLAGS := -Wall -g -Os
++TARGET := tint
++OBJS := $(TARGET).o engine.o io.o utils.o
++
++# Make is silent per default, but 'make V=1' will show all compiler calls.
++ifneq ($(V),1)
++Q := @
++endif
++
++all: $(TARGET).elf
++# printf" CC $(CC)\n"
++
++$(TARGET).elf: $(OBJS) libpayload
++ $(Q)printf " LPCC $(subst $(shell pwd)/,,$(@))\n"
++ $(Q)$(LPCC) -o $@ $(OBJS)
++ $(Q)$(OBJCOPY) --only-keep-debug $@ tint.debug
++ $(Q)$(OBJCOPY) --strip-debug $@
++ $(Q)$(OBJCOPY) --add-gnu-debuglink=tint.debug $@
++
++%.o: %.c libpayload
++ $(Q)printf " LPCC $(subst $(shell pwd)/,,$(@))\n"
++ $(Q)$(LPCC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
++
++%.S.o: %.S libpayload
++ $(Q)printf " LPAS $(subst $(shell pwd)/,,$(@))\n"
++ $(Q)$(LPAS) $(ASFLAGS) --32 -o $@ $<
++
++ifneq ($(strip $(HAVE_LIBPAYLOAD)),)
++libpayload:
++ $(Q)printf "Found Libpayload $(LIBPAYLOAD_DIR).\n"
++else
++libpayload:
++ $(Q)printf "Building libpayload @ $(LIBCONFIG_PATH).\n"
++ $(Q)make -C $(LIBCONFIG_PATH) distclean
++ $(Q)make -C $(LIBCONFIG_PATH) $(LIB_CONFIG)
++ $(Q)make -C $(LIBCONFIG_PATH) DESTDIR=$(shell pwd)/$(LIBPAYLOAD_DIR) install
++endif
++
++clean:
++ $(Q)rm -f $(TARGET).elf $(TARGET).debug *.o
++ $(Q)rm .xcompile
++
++distclean: clean
++ $(Q)rm -rf $(LIBPAYLOAD_DIR)
++
++# Original tint targets
++ifdef $(UNUSED)
++
+ #CROSS = arm-linux-
+
+ bindir = $(DESTDIR)/usr/games
+@@ -110,3 +169,4 @@ clean:
+ distclean: clean
+ $(MAKE) -C debian clean
+
++endif
+diff -rupN tintorig/config.h tint/config.h
+--- tintorig/config.h 2001-12-07 16:03:24.000000000 -0700
++++ tint/config.h 2010-01-27 13:59:18.000000000 -0700