Makefile 2.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#
# Makefile for Micrim uCOS-III for eco32
#

BUILD = /home/wiggum/git/eco32/build/bin/

LCC = $(BUILD)/lcc
LD = $(BUILD)/ld
LOAD = $(BUILD)/load

SIM = $(BUILD)/sim

UCOS_SRCS =	../Micrium/Software/uC-CPU/cpu_core.c \
			../Micrium/Software/uCOS-III/Source/os_q.c \
			../Micrium/Software/uCOS-III/Source/os_stat.c \
			../Micrium/Software/uCOS-III/Source/os_mutex.c \
			../Micrium/Software/uCOS-III/Source/os_prio.c \
			../Micrium/Software/uCOS-III/Source/os_sem.c \
			../Micrium/Software/uCOS-III/Source/os_var.c \
			../Micrium/Software/uCOS-III/Source/os_core.c \
			../Micrium/Software/uCOS-III/Source/os_pend_multi.c \
			../Micrium/Software/uCOS-III/Source/os_dbg.c \
			../Micrium/Software/uCOS-III/Source/os_tick.c \
			../Micrium/Software/uCOS-III/Source/os_mem.c \
			../Micrium/Software/uCOS-III/Source/os_tmr.c \
			../Micrium/Software/uCOS-III/Source/os_flag.c \
			../Micrium/Software/uCOS-III/Source/os_msg.c \
			../Micrium/Software/uCOS-III/Source/os_task.c \
			../Micrium/Software/uCOS-III/Source/os_time.c \
			../Micrium/Software/uCOS-III/Source/os_int.c \
			../Micrium/Software/uCOS-III/Source/os_cfg_app.c \
			../Micrium/Software/uC-LIB/lib_mem.c \
			../Micrium/Software/uC-LIB/lib_math.c \
			../Micrium/Software/uC-LIB/lib_ascii.c \
			../Micrium/Software/uC-LIB/lib_str.c

ENTR_SRCS =	../Micrium/Software/Boards/THM/Generic/LCC/entry.s

BSP_SRCS =	../Micrium/Software/Boards/THM/Generic/BSP/bsp.c \
			../Micrium/Software/Boards/THM/Generic/BSP/bsp_timer.c

PORT_SRCS =	../Micrium/Software/uC-CPU/ECO32/LCC/cpu_a.s \
			../Micrium/Software/uCOS-III/Ports/ECO32/os_cpu_c.c \
			../Micrium/Software/uCOS-III/Ports/ECO32/LCC/os_cpu_a.s

APP_SRCS =	app.c

OBJS = 		$(addsuffix .o,$(basename $(ENTR_SRCS))) \
			$(addsuffix .o,$(basename $(BSP_SRCS))) \
			$(addsuffix .o,$(basename $(PORT_SRCS))) \
			$(addsuffix .o,$(basename $(UCOS_SRCS))) \
			$(addsuffix .o,$(basename $(APP_SRCS)))

INC_DIRS =	../Micrium/Software/uC-CPU \
			../Micrium/Software/uC-CPU/ECO32/LCC \
			../Micrium/Software/uCOS-III/Source \
			../Micrium/Software/uCOS-III/Ports/ECO32/LCC \
			../Micrium/Software/uC-LIB \
			../Micrium/Software/Boards/THM/Generic/BSP \
			./

INCS =		$(addprefix -I,$(INC_DIRS))

EXE = 		uCOSApp
BIN = 		uCOSApp.bin
MAP = 		uCOSApp.map


all: $(BIN)

run: $(BIN)
	$(SIM) -l $(BIN) -i -a 0x00000000 -s 1 -t 0

$(BIN): $(EXE)
	@echo "  LOAD $@"
	@$(LOAD) -p $(EXE) $(BIN)

$(EXE): $(OBJS)
	@echo "  LD   $@"
	@$(LD) $(OBJS) -s standalone.lnk -m $(MAP) -o $(EXE)

%.o: %.c
	@echo "  CC   $@"
	@$(LCC) -Wo-nostdinc -Wo-nostdlib $(INCS) -c -o $@ $^

%.o: %.s
	@echo "  AS   $@"
	@$(LCC) -Wo-nostdinc -Wo-nostdlib -c -o $@ $^

clean:
	@echo "cleaning up.."
	@rm -f $(OBJS) $(EXE) $(BIN) $(MAP)