aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGreg Bellows <greg.bellows@linaro.org>2014-07-03 09:08:24 -0500
committerGreg Bellows <greg.bellows@linaro.org>2014-07-03 09:08:24 -0500
commit42b75de09a941b7e655452d8f2adf06587dde949 (patch)
tree298f4b3a40f64cf8c4f194d6dcd85399946e017a /Makefile
Initial project commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6b3e92b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,47 @@
+# Makefile - build a kernel+filesystem image for stand-alone Linux booting
+#
+# Copyright (C) 2011 ARM Limited. All rights reserved.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE.txt file.
+
+TZBOOT = tzboot.S
+OBJS = tzboot.o tztest.o string.o semihosting.o
+
+TEST = tztest
+TESTIMAGE = tztest.img
+LD_SCRIPT = tztest.lds.S
+
+CC = $(CROSS_COMPILE)gcc
+LD = $(CROSS_COMPILE)ld
+CP = $(CROSS_COMPILE)objcopy
+CPPFLAGS = -march=armv7-a -marm -g -O0 -DVEXPRESS
+
+# These are needed by the underlying kernel make
+export CROSS_COMPILE ARCH
+
+# Build all wrappers
+all: $(TEST)
+
+clean distclean:
+ rm -f $(TEST) $(TESTIMAGE) \
+ tztest.lds $(OBJS)
+
+$(TEST): $(OBJS) tztest.lds
+ $(LD) -o $@ $(OBJS) --script=tztest.lds
+ $(CP) -O binary $(TEST) $(TESTIMAGE)
+
+boot.o: $(TZBOOT)
+ $(CC) $(CPPFLAGS) -c -o $@ $<
+
+%.o: %.c
+ $(CC) $(CPPFLAGS) -O2 -I. -c -o $@ $<
+
+tztest.lds: $(LD_SCRIPT) Makefile
+ $(CC) $(CPPFLAGS) -E -P -C -o $@ $<
+
+force: ;
+
+Makefile: ;
+
+.PHONY: all clean distclean