summaryrefslogtreecommitdiff
path: root/src/modules/test/Makefile
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-02-06 20:51:56 +0100
committerAlexis211 <alexis211@gmail.com>2010-02-06 20:51:56 +0100
commit6a52d123672b7a00af6e22b4c138205be2042a94 (patch)
treecd9b0a13490159369a66c850850596fd4b418139 /src/modules/test/Makefile
parent3558f18daf50281ee1cd68cca96cd967dbac04ba (diff)
downloadTCE-6a52d123672b7a00af6e22b4c138205be2042a94.tar.gz
TCE-6a52d123672b7a00af6e22b4c138205be2042a94.zip
Reorganisation
Diffstat (limited to 'src/modules/test/Makefile')
-rw-r--r--src/modules/test/Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/modules/test/Makefile b/src/modules/test/Makefile
new file mode 100644
index 0000000..105aa54
--- /dev/null
+++ b/src/modules/test/Makefile
@@ -0,0 +1,32 @@
+.PHONY: clean, mrproper
+
+CC = gcc
+CFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra -I ../../library
+
+LD = ld
+LDFLAGS = -T ../../library/link.ld -L ../../library
+
+Objects = main.o
+Outfile = test.elf
+
+all: $(Outfile)
+ echo "* Done with $(Outfile)"
+
+rebuild: mrproper all
+
+$(Outfile): $(Objects)
+ echo "* Linking $@..."
+ $(LD) $(LDFLAGS) -o $@ $^
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+clean:
+ echo "* Removing objects..."
+ rm *.o || exit 0
+ rm $(Objects) || exit 0
+
+mrproper: clean
+ rm *.elf || exit 0
+ rm $(Outfile) || exit 0
+