2015-04-04 16:49:53 -04:00
|
|
|
CC ?= gcc
|
|
|
|
CFLAGS += -Iinclude -Ilibsparse/include
|
|
|
|
|
2015-09-14 10:59:13 -04:00
|
|
|
ifeq ($(STATIC),1)
|
|
|
|
ZLIB := -Wl,-Bstatic -lz -Wl,-Bdynamic
|
|
|
|
else
|
|
|
|
ZLIB := -lz
|
|
|
|
endif
|
|
|
|
|
2015-04-04 16:49:53 -04:00
|
|
|
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
|
2020-01-05 11:35:25 -05:00
|
|
|
$(CC) $(LDFLAGS)-o $@ $^ $(ZLIB)
|
2015-04-04 16:49:53 -04:00
|
|
|
|
|
|
|
libsparse/libsparse.a:
|
|
|
|
$(MAKE) -C libsparse/ libsparse.a
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(MAKE) -C libsparse/ clean
|
|
|
|
rm -f $(OBJ) make_ext4fs
|