From 804f4df5bdbe5244c8f4f15c5d50d223f8a11c34 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 9 Apr 2008 23:48:48 +0000 Subject: 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 Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3227 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/sample/Makefile | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'payloads/libpayload/sample') diff --git a/payloads/libpayload/sample/Makefile b/payloads/libpayload/sample/Makefile index e01d4e85df..497f051999 100644 --- a/payloads/libpayload/sample/Makefile +++ b/payloads/libpayload/sample/Makefile @@ -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 + -- cgit v1.2.3