(aesthetic; modified makefile)

partial-rewrite
Ben Blazak 2012-04-25 00:14:12 -07:00
parent 241e90104a
commit b6cc6108ae
1 changed files with 10 additions and 10 deletions

View File

@ -67,28 +67,28 @@ CFLAGS += -fdata-sections # / section in the output file if the
# linker optimizations, and discarding
# unused code.
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CFLAGS += -MMD -MP -MF $@.dep # generate dependency files
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LDFLAGS = -Wl,--relax # for some linker optimizations
LDFLAGS += -Wl,--gc-sections # discard unused functions and data
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GENDEPFLAGS += -MMD -MP -MF $@.dep # generate dependency files
CC = avr-gcc
OBJCOPY = avr-objcopy
SIZE = avr-size
# remove extraneous whitespace
TARGET := $(strip $(TARGET))
FORMAT := $(strip $(FORMAT))
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
.PHONY: all clean
# remove extraneous whitespace
FORMAT := $(strip $(FORMAT))
TARGET := $(strip $(TARGET))
CFLAGS := $(strip $(CFLAGS))
LDFLAGS := $(strip $(LDFLAGS))
all: $(TARGET).hex $(TARGET).eep
@echo
@echo '---------------------------------------------------------------'
@ -140,12 +140,12 @@ clean:
%.elf: $(OBJ)
@echo
@echo --- making $@ ---
$(CC) $(CFLAGS) $(LDFLAGS) $^ --output $@
$(CC) $(strip $(CFLAGS)) $(strip $(LDFLAGS)) $^ --output $@
%.o: %.c
@echo
@echo --- making $@ ---
$(CC) -c $(CFLAGS) $< -o $@
$(CC) -c $(strip $(CFLAGS)) $(strip $(GENDEPFLAGS)) $< -o $@
# -----------------------------------------------------------------------------