summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 4a22ea140ee22d6eacc72279fe487f50f6347feb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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