Make the sample Makefile a bit more generic, so it can be adapted more

easily for other payloads. Also, add a 'distclean' target (trivial).

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3227 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Uwe Hermann 2008-04-09 23:48:48 +00:00
parent c3e728fbdf
commit 804f4df5bd
1 changed files with 16 additions and 7 deletions

View File

@ -29,17 +29,26 @@
# Sample libpayload Makefile.
CC := ../bin/lpgcc
LIBPAYLOAD_DIR := ..
CC := $(LIBPAYLOAD_DIR)/bin/lpgcc
AS := $(LIBPAYLOAD_DIR)/bin/lpas
CFLAGS := -Wall -Werror -Os
TARGET := hello
OBJS := $(TARGET).o
all: hello.elf
all: $(TARGET).elf
hello.elf: hello.o
$(CC) -o $@ hello.o
$(TARGET).elf: $(OBJS)
$(CC) -o $@ $(OBJS)
hello.o: hello.c
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.S.o: %.S
$(AS) --32 -o $@ $<
clean:
rm -f hello.elf hello.o
rm -f $(TARGET).elf *.o
distclean: clean