2015-10-21 22:00:41 +02:00
|
|
|
##
|
util/: Replace GPLv2 boiler plate with SPDX header
Used commands:
perl -i -p0e 's|\/\*[\s*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-only */|' $(cat filelist)
perl -i -p0e 's|This[\s*]*program[\s*]*is[\s*]*free[\s*]*software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*either[\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License,[\s*]*or[\s*]*.at[\s*]*your[\s*]*option.*[\s*]*any[\s*]*later[\s*]*version.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-or-later */|' $(cat filelist)
perl -i -p0e 's|\/\*[\s*]*.*This[\s*#]*program[\s*#]*is[\s*#]*free[\s*#]*software[;:,][\s*#]*you[\s*#]*can[\s*#]*redistribute[\s*#]*it[\s*#]*and/or[\s*#]*modify[\s*#]*it[\s*#]*under[\s*#]*the[\s*#]*terms[\s*#]*of[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*as[\s*#]*published[\s*#]*by[\s*#]*the[\s*#]*Free[\s*#]*Software[\s*#]*Foundation[;:,][\s*#]*either[\s*#]*version[\s*#]*3[\s*#]*of[\s*#]*the[\s*#]*License[;:,][\s*#]*or[\s*#]*.at[\s*#]*your[\s*#]*option.*[\s*#]*any[\s*#]*later[\s*#]*version.[\s*#]*This[\s*#]*program[\s*#]*is[\s*#]*distributed[\s*#]*in[\s*#]*the[\s*#]*hope[\s*#]*that[\s*#]*it[\s*#]*will[\s*#]*be[\s*#]*useful[;:,][\s*#]*but[\s*#]*WITHOUT[\s*#]*ANY[\s*#]*WARRANTY[;:,][\s*#]*without[\s*#]*even[\s*#]*the[\s*#]*implied[\s*#]*warranty[\s*#]*of[\s*#]*MERCHANTABILITY[\s*#]*or[\s*#]*FITNESS[\s*#]*FOR[\s*#]*A[\s*#]*PARTICULAR[\s*#]*PURPOSE.[\s*#]*See[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*for[\s*#]*more[\s*#]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-3.0-or-later */|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w]*.*is free software[:;][\#\s]*you[\#\s]*can[\#\s]*redistribute[\#\s]*it[\#\s]*and\/or[\#\s]*modify[\#\s]*it[\s\#]*under[\s \#]*the[\s\#]*terms[\s\#]*of[\s\#]*the[\s\#]*GNU[\s\#]*General[\s\#]*Public[\s\#]*License[\s\#]*as[\s\#]*published[\s\#]*by[\s\#]*the[\s\#]*Free[\s\#]*Software[\s\#]*Foundation[;,][\s\#]*version[\s\#]*2[\s\#]*of[\s\#]*the[\s\#]*License.*[\s\#]*This[\s\#]*program[\s\#]*is[\s\#]*distributed[\s\#]*in[\s\#]*the[\s\#]*hope[\s\#]*that[\s\#]*it[\s\#]*will[\#\s]*be[\#\s]*useful,[\#\s]*but[\#\s]*WITHOUT[\#\s]*ANY[\#\s]*WARRANTY;[\#\s]*without[\#\s]*even[\#\s]*the[\#\s]*implied[\#\s]*warranty[\#\s]*of[\#\s]*MERCHANTABILITY[\#\s]*or[\#\s]*FITNESS[\#\s]*FOR[\#\s]*A[\#\s]*PARTICULAR[\#\s]*PURPOSE.[\#\s]*See[\#\s]*the[\#\s]*GNU[\#\s]*General[\#\s]*Public[\#\s]*License[\#\s]*for[\#\s]*more[\#\s]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
Change-Id: I1008a63b804f355a916221ac994701d7584f60ff
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41177
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-05-08 20:48:04 +02:00
|
|
|
## SPDX-License-Identifier: GPL-2.0-only
|
2015-10-21 22:00:41 +02:00
|
|
|
|
2005-01-17 12:08:08 +01:00
|
|
|
# NOTE: You need to add your libpci.a version to CFLAGS below if
|
|
|
|
# pci-userspace.c does not build.
|
|
|
|
#
|
|
|
|
# If you are building on AMD64, you have to use /usr/lib64/libpci.a instead of
|
|
|
|
# /usr/lib/...
|
|
|
|
#
|
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
TOP ?= ../..
|
2015-10-21 22:00:41 +02:00
|
|
|
OUT ?= build
|
2015-09-28 22:12:04 +02:00
|
|
|
|
|
|
|
CC ?= gcc
|
|
|
|
CFLAGS ?= -O2 -g -fomit-frame-pointer
|
|
|
|
|
2010-04-16 13:45:16 +02:00
|
|
|
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
|
2015-09-28 22:12:04 +02:00
|
|
|
CFLAGS += -Wwrite-strings -Wredundant-decls -Wstrict-aliasing -Wshadow -Wextra
|
2015-10-21 22:00:41 +02:00
|
|
|
CFLAGS += -Wno-unused-but-set-variable
|
2015-09-28 22:12:04 +02:00
|
|
|
|
|
|
|
# TODO check host architecture
|
2015-10-21 22:00:41 +02:00
|
|
|
CBCFLAGS = -Wno-sign-compare -Wno-unused-parameter -Wno-format
|
|
|
|
|
|
|
|
INCLUDES = -Iinclude -I$(OUT)/include
|
|
|
|
INCLUDES += -I$(TOP)/src/device/oprom/include/
|
|
|
|
INCLUDES += -I$(TOP)/src/device/oprom/yabel
|
|
|
|
INCLUDES += -include $(TOP)/src/commonlib/include/commonlib/loglevel.h
|
|
|
|
INCLUDES += -include stdtypes.h -include pci-userspace.h
|
|
|
|
INCLUDES += -include $(TOP)/src/include/kconfig.h
|
|
|
|
|
|
|
|
CBINCLUDES = -I$(TOP)/src -include include/stdtypes.h -include $(TOP)/src/include/endian.h
|
|
|
|
CBINCLUDES += -include stdio.h -include sys/io.h
|
|
|
|
|
|
|
|
SOURCE = testbios.c
|
|
|
|
SOURCE += pci-userspace.c
|
|
|
|
SOURCE += device.c
|
2010-04-16 13:45:16 +02:00
|
|
|
|
2015-10-21 22:00:41 +02:00
|
|
|
X86EMU = x86emu/sys.c x86emu/decode.c x86emu/ops.c x86emu/ops2.c
|
|
|
|
X86EMU += x86emu/prim_ops.c x86emu/fpu.c x86emu/debug.c
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-10-21 22:00:41 +02:00
|
|
|
X86EMU += yabel/interrupt.c
|
|
|
|
X86EMU += yabel/mem.c
|
|
|
|
X86EMU += yabel/io.c
|
|
|
|
X86EMU += yabel/pmm.c
|
|
|
|
X86EMU += yabel/biosemu.c
|
|
|
|
X86EMU += yabel/debug.c
|
|
|
|
#X86EMU += yabel/device.c # For now we need a local copy :-(
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-10-21 22:00:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
X86EMU_DIR = $(TOP)/src/device/oprom
|
2015-09-28 22:12:04 +02:00
|
|
|
X86EMU_SOURCE = $(addprefix $(X86EMU_DIR)/, $(X86EMU))
|
2015-10-21 22:00:41 +02:00
|
|
|
OBJECTS:=$(addprefix $(OUT)/,$(SOURCE:.c=.o)) $(addprefix $(OUT)/, $(X86EMU:.c=.o))
|
2010-03-23 16:53:38 +01:00
|
|
|
|
|
|
|
LIBS=-lpci
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
all: dep testbios
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-10-21 22:00:41 +02:00
|
|
|
$(OBJECTS): includes
|
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
testbios: $(OBJECTS)
|
|
|
|
printf " LINK $(notdir $@)\n"
|
2010-03-23 16:53:38 +01:00
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
dep: $(SOURCE) $(X86EMU_SOURCE) Makefile
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) -MM $(SOURCE) > .dependencies
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) $(CBCFLAGS) $(CBINCLUDES) -MM $(X86EMU_SOURCE) >> .dependencies
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-10-21 22:00:41 +02:00
|
|
|
# Make all the dummy include files (that are in reality
|
|
|
|
# covered by all the -include statements above)
|
|
|
|
includes:
|
|
|
|
mkdir -p $(OUT)/include/device
|
|
|
|
mkdir -p $(OUT)/include/arch
|
|
|
|
touch $(OUT)/include/device/device.h
|
|
|
|
touch $(OUT)/include/device/pci.h
|
|
|
|
touch $(OUT)/include/device/pci_ops.h
|
|
|
|
touch $(OUT)/include/device/resource.h
|
|
|
|
touch $(OUT)/include/arch/io.h
|
|
|
|
touch $(OUT)/include/timer.h
|
|
|
|
touch $(OUT)/include/types.h
|
|
|
|
|
2004-07-08 19:18:27 +02:00
|
|
|
clean:
|
2015-10-21 22:00:41 +02:00
|
|
|
rm -f $(OBJECTS) *~ testbios
|
|
|
|
rm -rf $(OUT)
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
distclean: clean
|
|
|
|
rm -f .dependencies
|
|
|
|
|
2015-10-21 22:00:41 +02:00
|
|
|
$(OUT)/%.o: $(X86EMU_DIR)/%.c
|
2015-09-28 22:12:04 +02:00
|
|
|
printf " CC (x86emu) $(notdir $<)\n"
|
2015-10-21 22:00:41 +02:00
|
|
|
mkdir -p $(dir $@)
|
2015-09-28 22:12:04 +02:00
|
|
|
$(CC) $(CFLAGS) $(CBCFLAGS) $(INCLUDES) $(CBINCLUDES) -c -o $@ $<
|
2010-04-16 13:45:16 +02:00
|
|
|
|
2015-10-21 22:00:41 +02:00
|
|
|
$(OUT)/%.o: %.c
|
2015-09-28 22:12:04 +02:00
|
|
|
printf " CC $(notdir $<)\n"
|
2015-10-21 22:00:41 +02:00
|
|
|
mkdir -p $(dir $@)
|
2010-04-16 13:45:16 +02:00
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
|
2015-09-28 22:12:04 +02:00
|
|
|
|
2015-10-21 22:00:41 +02:00
|
|
|
.PHONY: all includes clean distclean
|
2015-09-28 22:12:04 +02:00
|
|
|
.SILENT:
|
|
|
|
|
|
|
|
-include .dependencies
|