From 77fb9cc13c319152568e2d9399b1f3e4202574b4 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sun, 2 Mar 2014 21:27:15 +0100 Subject: begin rework --- Makefile | 24 ++++++++---------------- kernel/sched/include/sched/sched.h | 2 +- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 1d20a43..41c8458 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ TARGET=firmware SERIAL=/dev/ttyACM0 BAUD=115200 +# Modules to include in kernel +MODULES=collection sched time tshield bug serial + # Toolchain flags CC=avr-gcc CFLAGS= -std=gnu99 -O2 -Wall -finline-functions -ffunction-sections -fdata-sections -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -mmcu=$(MCU) -DF_CPU=$(F_CPU) @@ -28,10 +31,8 @@ CPP=avr-g++ CPPFLAGS= -O2 -Wall -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -mmcu=$(MCU) -DF_CPU=$(F_CPU) GDBINITFILE=gdb.conf -MODULES=collection sched time tshield bug serial - +# Derived variables SOURCES=\ - $(foreach module,$(MODULES),$(wildcard kernel/$(module)/*.S)) \ $(foreach module,$(MODULES),$(wildcard kernel/$(module)/*.c)) \ $(foreach module,$(MODULES),$(wildcard kernel/$(module)/mcu/$(MCU)/*.S)) \ $(foreach module,$(MODULES),$(wildcard kernel/$(module)/mcu/$(MCU)/*.c)) \ @@ -39,13 +40,11 @@ SOURCES=\ $(wildcard *.s) $(wildcard *.c) $(wildcard *.cpp) OBJECTS=$(addsuffix .o, $(basename $(SOURCES))) + INCLUDES=\ $(foreach module, $(MODULES), kernel/$(module)/include) \ $(foreach module, $(MODULES), kernel/$(module)/mcu/$(MCU)/include) -ARDUINO_INCLUDES=arduino arduino/variants/mega - - # Rules all: target @@ -57,13 +56,6 @@ $(TARGET).hex: $(TARGET).elf $(TARGET).elf: $(OBJECTS) $(LD) $(LDFLAGS) -o $@ $^ -# Arduino sources need special includes -arduino/%.o: arduino/%.c - $(CC) $(CFLAGS) $(addprefix -I, $(ARDUINO_INCLUDES)) $(addprefix -I, $(INCLUDES)) -o $@ -c $< - -arduino/%.o: arduino/%.cpp - $(CPP) $(CPPFLAGS) $(addprefix -I, $(ARDUINO_INCLUDES)) $(addprefix -I, $(INCLUDES)) -o $@ -c $< - # Kernel sources kernel/%.o: kernel/%.S $(CC) $(CFLAGS) -o $@ -c $< @@ -73,13 +65,13 @@ kernel/%.o: kernel/%.c # Local sources may use arduino and therfore need special includes %.o: %.s - $(CC) $(CFLAGS) $(addprefix -I, $(ARDUINO_INCLUDES)) -I$(dir $<) $(addprefix -I, $(INCLUDES)) -o $@ -c $< + $(CC) $(CFLAGS) -I$(dir $<) $(addprefix -I, $(INCLUDES)) -o $@ -c $< %.o: %.c - $(CC) $(CFLAGS) $(addprefix -I, $(ARDUINO_INCLUDES)) -I$(dir $<) $(addprefix -I, $(INCLUDES)) -o $@ -c $< + $(CC) $(CFLAGS) -I$(dir $<) $(addprefix -I, $(INCLUDES)) -o $@ -c $< %.o: %.cpp - $(CPP) $(CPPFLAGS) $(addprefix -I, $(ARDUINO_INCLUDES)) -I$(dir $<) $(addprefix -I, $(INCLUDES)) -o $@ -c $< + $(CPP) $(CPPFLAGS) -I$(dir $<) $(addprefix -I, $(INCLUDES)) -o $@ -c $< # Utility rules diff --git a/kernel/sched/include/sched/sched.h b/kernel/sched/include/sched/sched.h index f7bafcd..5db0502 100644 --- a/kernel/sched/include/sched/sched.h +++ b/kernel/sched/include/sched/sched.h @@ -12,7 +12,7 @@ /** * Task control block, contains runtime - * information of tasks. + * information about tasks. */ struct tcb_t { /** Stack pointer of this task. (must be first in structure) */ -- cgit v1.2.3