diff options
Diffstat (limited to 'roms/skiboot/external/ffspart/rules.mk')
-rw-r--r-- | roms/skiboot/external/ffspart/rules.mk | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/roms/skiboot/external/ffspart/rules.mk b/roms/skiboot/external/ffspart/rules.mk new file mode 100644 index 000000000..e006dc5b7 --- /dev/null +++ b/roms/skiboot/external/ffspart/rules.mk @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +.DEFAULT_GOAL := all + +override CFLAGS += -O2 -Wall -g -I. +EXE = ffspart +OBJS = $(EXE).o version.o +LIBFLASH_FILES := libflash.c libffs.c ecc.c blocklevel.c file.c +LIBFLASH_OBJS := $(addprefix libflash-, $(LIBFLASH_FILES:.c=.o)) +LIBFLASH_SRC := $(addprefix libflash/,$(LIBFLASH_FILES)) +OBJS += $(LIBFLASH_OBJS) +OBJS += common-arch_flash.o + +prefix = /usr/local/ +sbindir = $(prefix)/sbin + +CC = $(CROSS_COMPILE)gcc + +FFSPART_VERSION ?= $(shell ./make_version.sh $(EXE)) + +version.c: make_version.sh .version + @(if [ "a$(FFSPART_VERSION)" = "a" ]; then \ + echo "#error You need to set FFSPART_VERSION environment variable" > $@ ;\ + else \ + echo "const char version[] = \"$(FFSPART_VERSION)\";" ;\ + fi) > $@ + +%.o : %.c + $(Q_CC)$(CC) $(CFLAGS) -c $< -o $@ + +$(LIBFLASH_SRC): | links + +$(LIBFLASH_OBJS): libflash-%.o : libflash/%.c + $(Q_CC)$(CC) $(CFLAGS) -c $< -o $@ + +$(EXE): $(OBJS) + $(Q_CC)$(CC) $(CFLAGS) $^ -lrt -o $@ + |