make_ext4fs/Makefile
Hauke Mehrtens 5c201be7d7 Add LDFLAGS when building libsparse.a
Respect the LDFALGS provided from the outside when linking libsparse.a

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-01-05 17:38:08 +01:00

38 lines
618 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