aboutsummaryrefslogtreecommitdiff
path: root/payloads/libpayload/sample
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2008-04-09 23:48:48 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2008-04-09 23:48:48 +0000
commit804f4df5bdbe5244c8f4f15c5d50d223f8a11c34 (patch)
treecc60e55b72ac1aea025429ece3b66e8ac4cd2b77 /payloads/libpayload/sample
parentc3e728fbdfa6a92a9b07e46d0ae0da7259e29d35 (diff)
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
Diffstat (limited to 'payloads/libpayload/sample')
-rw-r--r--payloads/libpayload/sample/Makefile23
1 files changed, 16 insertions, 7 deletions
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
+