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