summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2019-04-24 00:20:03 (GMT)
committerGitHub <noreply@github.com>2019-04-24 00:20:03 (GMT)
commitf9781a66432c30281f6d775055281555b6be9a31 (patch)
tree42beff869ceab927ca8b6e08c8b337f0384bd022
parent49c20c498b80e70bae3ae604ef468921d79d2121 (diff)
parent0d3f85df651cf298e0a60c646e119e3e5fd90c72 (diff)
downloadlz4-f9781a66432c30281f6d775055281555b6be9a31.zip
lz4-f9781a66432c30281f6d775055281555b6be9a31.tar.gz
lz4-f9781a66432c30281f6d775055281555b6be9a31.tar.bz2
Merge pull request #697 from ldv-alt/fixes/test-amalgamation
Fix test-amalgamation
-rw-r--r--lib/README.md4
-rw-r--r--tests/Makefile16
2 files changed, 9 insertions, 11 deletions
diff --git a/lib/README.md b/lib/README.md
index b753195..cf1505f 100644
--- a/lib/README.md
+++ b/lib/README.md
@@ -74,9 +74,7 @@ The following build macro can be selected at compilation time :
lz4 source code can be amalgamated into a single file.
One can combine all source code into `lz4_all.c` by using following command:
```
-cat lz4.c > lz4_all.c
-cat lz4hc.c >> lz4_all.c
-cat lz4frame.c >> lz4_all.c
+cat lz4.c lz4hc.c lz4frame.c > lz4_all.c
```
(`cat` file order is important) then compile `lz4_all.c`.
All `*.h` files present in `/lib` remain necessary to compile `lz4_all.c`.
diff --git a/tests/Makefile b/tests/Makefile
index 67514e4..8f0dfd3 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -114,7 +114,7 @@ clean:
frametest$(EXT) frametest32$(EXT) \
fasttest$(EXT) roundTripTest$(EXT) \
datagen$(EXT) checkTag$(EXT) \
- frameTest$(EXT)
+ frameTest$(EXT) lz4_all.c
@$(RM) -rf $(TESTDIR)
@echo Cleaning completed
@@ -156,13 +156,13 @@ test: test-lz4 test-lz4c test-frametest test-fullbench test-fuzzer test-install
test32: CFLAGS+=-m32
test32: test
-.PHONY: test-amalgamation
-test-amalgamation: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c
- cat $(LZ4DIR)/lz4.c > lz4_all.c
- cat $(LZ4DIR)/lz4hc.c >> lz4_all.c
- cat $(LZ4DIR)/lz4frame.c >> lz4_all.c
- $(CC) -I$(LZ4DIR) -c lz4_all.c
- $(RM) lz4_all.c
+test-amalgamation: lz4_all.o
+
+lz4_all.o: lz4_all.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $^ -o $@
+
+lz4_all.c: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c
+ cat $^ > $@
test-install: lz4 lib liblz4.pc
lz4_root=.. ./test_install.sh