From 6a52d123672b7a00af6e22b4c138205be2042a94 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sat, 6 Feb 2010 20:51:56 +0100 Subject: Reorganisation --- src/modules/test/Makefile | 32 ++++++++++++++++++++++++++++++++ src/modules/test/main.c | 8 ++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/modules/test/Makefile create mode 100644 src/modules/test/main.c (limited to 'src/modules/test') 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 + diff --git a/src/modules/test/main.c b/src/modules/test/main.c new file mode 100644 index 0000000..3ac5cb5 --- /dev/null +++ b/src/modules/test/main.c @@ -0,0 +1,8 @@ +#include + +int main() { + printk("[module:test] Hi world !\n"); + thread_sleep(5000); + printk("[module:test] 5sec later...\n"); + return 0; +} -- cgit v1.2.3