mirror of
https://git.openwrt.org/project/make_ext4fs.git
synced 2025-05-11 17:34:56 +00:00

If LDFLAGS is non-empty then next standing "-o" flag may be mistakenly appended to it leading to build error. Fixes: 5c201be7d72a ("Add LDFLAGS when building libsparse.a") Signed-off-by: Konstantin Demin <rockdrilla@gmail.com> [ improve commit description ] Link: https://github.com/openwrt/make_ext4fs/pull/3 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
38 lines
619 B
Makefile
38 lines
619 B
Makefile
CC ?= gcc
|
|
CFLAGS += -Iinclude -Ilibsparse/include
|
|
|
|
ifeq ($(STATIC),1)
|
|
ZLIB := -Wl,-Bstatic -lz -Wl,-Bdynamic
|
|
else
|
|
ZLIB := -lz
|
|
endif
|
|
|
|
OBJ := \
|
|
allocate.o \
|
|
canned_fs_config.o \
|
|
contents.o \
|
|
crc16.o \
|
|
ext4fixup.o \
|
|
ext4_sb.o \
|
|
ext4_utils.o \
|
|
extent.o \
|
|
indirect.o \
|
|
make_ext4fs_main.o \
|
|
make_ext4fs.o \
|
|
sha1.o \
|
|
uuid.o \
|
|
wipe.o
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
make_ext4fs: $(OBJ) libsparse/libsparse.a
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(ZLIB)
|
|
|
|
libsparse/libsparse.a:
|
|
$(MAKE) -C libsparse/ libsparse.a
|
|
|
|
clean:
|
|
$(MAKE) -C libsparse/ clean
|
|
rm -f $(OBJ) make_ext4fs
|