Subversion Repositories freemyipod

Rev

Rev 253 | Rev 462 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
253 theseven 1
NAME := uclstub
2
 
457 theseven 3
CROSS   ?= arm-elf-eabi-
253 theseven 4
CC      := $(CROSS)gcc
5
AS      := $(CROSS)as
6
LD      := $(CROSS)ld
7
OBJCOPY := $(CROSS)objcopy
8
 
9
CFLAGS  += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -ffunction-sections -fdata-sections -mcpu=arm940t
10
LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" --gc-sections
11
 
12
SRC := ucl.S
13
OBJ := $(SRC:%.S=build/%.o)
14
 
15
all: $(NAME)
16
 
17
$(NAME): build/$(NAME).bin
18
 
19
build/$(NAME).bin: build/$(NAME).elf
20
	@echo [OC]     $<
21
	@$(OBJCOPY) -O binary $^ $@
22
 
23
build/$(NAME).elf: $(OBJ) ls.x
24
	@echo [LD]     $@
25
	@$(LD) $(LDFLAGS) -T ls.x -o $@ $(OBJ)
26
 
27
build/%.o: %.S
28
	@echo [CC]     $<
29
ifeq ($(shell uname),WindowsNT)
30
	@-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
31
else
32
	@-mkdir -p $(dir $@)
33
endif
34
	@$(CC) -c $(CFLAGS) -o $@ $<
35
 
36
clean:
37
	rm -rf build
38
 
39
.PHONY: all clean $(NAME)