From 980d2f10a80f5c1f844809a3ecdea44b8a4235b3 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 4 Jul 2011 06:08:19 +0000 Subject: split build tree rearange Makefiles --- kernel/Makefile | 64 ++----------------------------------------------- kernel/Makefile.inc | 48 +++++++++++++++++++++++++++++++++++++ kernel/remix16/Makefile | 16 +++++++++++++ 3 files changed, 66 insertions(+), 62 deletions(-) create mode 100644 kernel/Makefile.inc create mode 100644 kernel/remix16/Makefile diff --git a/kernel/Makefile b/kernel/Makefile index a6f49f2..8f6b505 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,65 +1,5 @@ # $Id$ -PROG = kernel -SRCS = kernel.c main.c uart.c heartbeat.c rgb.c hsv.c lcd3.c \ - adc.c ppm.c -HEADERS = kernel.h stack.h -MCU_TARGET = atmega8 -F_CPU = 16000000 -PRESCALE = 8 -STACK = 64 -TASKS = 8 -SEMAPHORES = 8 -BAUD = 9600 +SUBDIR= remix16 -# You should not have to change anything below here. - -CC = avr-gcc -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size -OBJS = ${SRCS:.c=.o} -CFLAGS = -Wall -Os -mmcu=${MCU_TARGET} \ - -DF_CPU=${F_CPU} -DPRESCALE=${PRESCALE} -DBAUD=${BAUD} \ - -DSTACK=${STACK} -DTASKS=${TASKS} -DSEMAPHORES=${SEMAPHORES} -LDFLAGS = -Wl,-Map,${PROG}.map - -.SUFFIXES: .elf .lst .hex .bin .srec .ehex .ebin .esrec - -all: ${PROG}.elf ${PROG}.lst ${PROG}.hex ${PROG}.ehex size - -${SRCS}: ${HEADERS} Makefile - -${PROG}.elf: ${OBJS} - ${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} - -size: ${PROG}.elf - ${SIZE} -C --mcu=${MCU_TARGET} ${.ALLSRC} - -clean: - rm -f *.o ${PROG}.elf *.bak *.lst *.map *.hex *.bin *srec *.ehex *.ebin *.esrec - -.elf.lst: - ${OBJDUMP} -h -S ${.IMPSRC} > ${.TARGET} - -# Rules for building the .text rom images - -.elf.hex: - ${OBJCOPY} -j .text -j .data -O ihex ${.IMPSRC} ${.TARGET} - -.elf.bin: - ${OBJCOPY} -j .text -j .data -O binary ${.IMPSRC} ${.TARGET} - -.elf.srec: - ${OBJCOPY} -j .text -j .data -O srec ${.IMPSRC} ${.TARGET} - -# Rules for building the .eeprom rom images - -.elf.ehex: - ${OBJCOPY} -j .eeprom --change-section-lma .eeprom=0 -O ihex ${.IMPSRC} ${.TARGET} - -.elf.ebin: - ${OBJCOPY} -j .eeprom --change-section-lma .eeprom=0 -O binary ${.IMPSRC} ${.TARGET} - -.elf.esrec: - ${OBJCOPY} -j .eeprom --change-section-lma .eeprom=0 -O srec ${.IMPSRC} ${.TARGET} +.include diff --git a/kernel/Makefile.inc b/kernel/Makefile.inc new file mode 100644 index 0000000..9417686 --- /dev/null +++ b/kernel/Makefile.inc @@ -0,0 +1,48 @@ +# $Id$ + +.PATH: ${.CURDIR}/.. + +CC= avr-gcc +OBJCOPY= avr-objcopy +OBJDUMP= avr-objdump +SIZE= avr-size + +CFLAGS= -Wall -Os -mmcu=${MCU} \ + -DF_CPU=${F_CPU} -DPRESCALE=${PRESCALE} -DBAUD=${BAUD} \ + -DSTACK=${STACK} -DTASKS=${TASKS} -DSEMAPHORES=${SEMAPHORES} +LDFLAGS= -Wl,-Map,${PROG}.map + +.SUFFIXES: .lst .hex .bin .srec .ehex .ebin .esrec + +all: ${PROG} ${PROG}.lst ${PROG}.hex ${PROG}.ehex size + +size: ${PROG} + ${SIZE} -C --mcu=${MCU} ${.ALLSRC} + +clean: + rm -f *.o ${PROG} *.bak *.lst *.map *.hex *.bin *srec *.ehex *.ebin *.esrec + +${PROG}.lst: ${PROG} + ${OBJDUMP} -h -S ${.ALLSRC} > ${.TARGET} + +# Rules for building the .text rom images + +${PROG}.hex: ${PROG} + ${OBJCOPY} -j .text -j .data -O ihex ${.ALLSRC} ${.TARGET} + +${PROG}.bin: ${PROG} + ${OBJCOPY} -j .text -j .data -O binary ${.ALLSRC} ${.TARGET} + +${PROG}.srec: ${PROG} + ${OBJCOPY} -j .text -j .data -O srec ${.ALLSRC} ${.TARGET} + +# Rules for building the .eeprom rom images + +${PROG}.ehex: ${PROG} + ${OBJCOPY} -j .eeprom --change-section-lma .eeprom=0 -O ihex ${.ALLSRC} ${.TARGET} + +${PROG}.ebin: ${PROG} + ${OBJCOPY} -j .eeprom --change-section-lma .eeprom=0 -O binary ${.ALLSRC} ${.TARGET} + +${PROG}.esrec: ${PROG} + ${OBJCOPY} -j .eeprom --change-section-lma .eeprom=0 -O srec ${.ALLSRC} ${.TARGET} diff --git a/kernel/remix16/Makefile b/kernel/remix16/Makefile new file mode 100644 index 0000000..e4e6dfe --- /dev/null +++ b/kernel/remix16/Makefile @@ -0,0 +1,16 @@ +# $Id$ + +MCU= atmega8 +F_CPU= 16000000 +PRESCALE= 8 +STACK= 64 +TASKS= 8 +SEMAPHORES= 8 +BAUD= 9600 + +PROG= kernel +SRCS= kernel.c main.c uart.c heartbeat.c rgb.c hsv.c lcd3.c \ + adc.c ppm.c +NOMAN= + +.include -- cgit v1.2.3