2008-03-20 00:56:58 +01:00
|
|
|
##
|
|
|
|
## This file is part of the libpayload project.
|
|
|
|
##
|
|
|
|
## Copyright (C) 2008 Advanced Micro Devices, Inc.
|
|
|
|
##
|
|
|
|
## Redistribution and use in source and binary forms, with or without
|
|
|
|
## modification, are permitted provided that the following conditions
|
|
|
|
## are met:
|
|
|
|
## 1. Redistributions of source code must retain the above copyright
|
|
|
|
## notice, this list of conditions and the following disclaimer.
|
|
|
|
## 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
## notice, this list of conditions and the following disclaimer in the
|
|
|
|
## documentation and/or other materials provided with the distribution.
|
|
|
|
## 3. The name of the author may not be used to endorse or promote products
|
|
|
|
## derived from this software without specific prior written permission.
|
|
|
|
##
|
|
|
|
## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
## SUCH DAMAGE.
|
|
|
|
##
|
|
|
|
|
|
|
|
# Sample libpayload Makefile.
|
2013-10-07 10:27:01 +02:00
|
|
|
include ../.xcompile
|
|
|
|
include ../.config
|
|
|
|
|
2014-10-12 16:37:42 +02:00
|
|
|
ARCH-$(CONFIG_LP_ARCH_ARMV) := arm
|
|
|
|
ARCH-$(CONFIG_LP_ARCH_POWERPC) := powerpc
|
|
|
|
ARCH-$(CONFIG_LP_ARCH_X86) := i386
|
2013-10-07 10:27:01 +02:00
|
|
|
|
|
|
|
CC := $(CC_$(ARCH-y))
|
|
|
|
AS := $(AS_$(ARCH-y))
|
2010-08-29 01:23:47 +02:00
|
|
|
LIBPAYLOAD_DIR := ../install/libpayload
|
2013-10-07 10:27:01 +02:00
|
|
|
XCC := CC="$(CC)" $(LIBPAYLOAD_DIR)/bin/lpgcc
|
|
|
|
XAS := AS="$(AS)" $(LIBPAYLOAD_DIR)/bin/lpas
|
2008-04-10 01:05:59 +02:00
|
|
|
CFLAGS := -Wall -Werror -Os
|
2008-04-10 01:48:48 +02:00
|
|
|
TARGET := hello
|
|
|
|
OBJS := $(TARGET).o
|
2008-03-20 00:56:58 +01:00
|
|
|
|
2008-04-10 01:48:48 +02:00
|
|
|
all: $(TARGET).elf
|
2008-03-20 00:56:58 +01:00
|
|
|
|
2008-04-10 01:48:48 +02:00
|
|
|
$(TARGET).elf: $(OBJS)
|
2010-08-29 01:23:47 +02:00
|
|
|
$(XCC) -o $@ $(OBJS)
|
2008-03-20 00:56:58 +01:00
|
|
|
|
2008-04-10 01:48:48 +02:00
|
|
|
%.o: %.c
|
2010-08-29 01:23:47 +02:00
|
|
|
$(XCC) $(CFLAGS) -c -o $@ $<
|
2008-03-20 00:56:58 +01:00
|
|
|
|
2008-04-10 01:48:48 +02:00
|
|
|
%.S.o: %.S
|
2010-08-29 01:23:47 +02:00
|
|
|
$(XAS) --32 -o $@ $<
|
2008-04-10 01:48:48 +02:00
|
|
|
|
2008-03-20 00:56:58 +01:00
|
|
|
clean:
|
2008-04-10 01:48:48 +02:00
|
|
|
rm -f $(TARGET).elf *.o
|
|
|
|
|
|
|
|
distclean: clean
|