test-amalgamation: use a single cat command

Use the list of prerequisites instead of listing those files manually,
this way they will never fall out of sync.

Also update the amalgamation example to use a single cat command.

Fixes: a7e8d394 ("[amalgamation] add test")
Fixes: b192c86b ("[amalgamation] lz4frame.c")
This commit is contained in:
Dmitry V. Levin 2019-04-23 21:18:11 +00:00
parent 7937e86255
commit 10726d4c56
2 changed files with 2 additions and 6 deletions

View File

@ -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`.

View File

@ -158,9 +158,7 @@ test32: test
.PHONY: test-amalgamation
test-amalgamation: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c
cat $(LZ4DIR)/lz4.c > lz4_all.c
cat $(LZ4DIR)/lz4hc.c >> lz4_all.c
cat $(LZ4DIR)/lz4frame.c >> lz4_all.c
cat $^ > lz4_all.c
$(CC) -I$(LZ4DIR) -c lz4_all.c
$(RM) lz4_all.c