projects
/
project
/
make_ext4fs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add option to link zlib statically
[project/make_ext4fs.git]
/
Makefile
diff --git
a/Makefile
b/Makefile
index
17b5d88
..
908e44a
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-1,6
+1,12
@@
CC ?= gcc
CFLAGS += -Iinclude -Ilibsparse/include
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 \
OBJ := \
allocate.o \
canned_fs_config.o \
@@
-21,7
+27,7
@@
OBJ := \
$(CC) $(CFLAGS) -c -o $@ $^
make_ext4fs: $(OBJ) libsparse/libsparse.a
$(CC) $(CFLAGS) -c -o $@ $^
make_ext4fs: $(OBJ) libsparse/libsparse.a
- $(CC) -o $@ $^
-lz
+ $(CC) -o $@ $^
$(ZLIB)
libsparse/libsparse.a:
$(MAKE) -C libsparse/ libsparse.a
libsparse/libsparse.a:
$(MAKE) -C libsparse/ libsparse.a