mirror of
https://github.com/facebook/zstd.git
synced 2024-11-25 16:16:43 +08:00
fixed Makefile targets: zstd-small, zstd-decompress, zstd-compress
This commit is contained in:
parent
ba49de38cf
commit
23cec875cd
@ -44,7 +44,7 @@ matrix:
|
||||
- qemu-user-static
|
||||
- os: linux
|
||||
sudo: required
|
||||
env: PLATFORM="Ubuntu 12.04" CMD="make -C tests versionsTest"
|
||||
env: PLATFORM="Ubuntu 12.04" CMD="make -C programs zstd-small && make -C programs zstd-decompress && make -C programs zstd-compress && make -C tests versionsTest"
|
||||
- os: linux
|
||||
sudo: required
|
||||
env: PLATFORM="Ubuntu 12.04" CMD="make asan32"
|
||||
|
@ -70,7 +70,7 @@ VOID = /dev/null
|
||||
endif
|
||||
|
||||
|
||||
.PHONY: default all clean install uninstall
|
||||
.PHONY: default all clean clean_decomp_o install uninstall
|
||||
|
||||
default: zstd
|
||||
|
||||
@ -92,7 +92,7 @@ zstd32 : $(ZSTDDECOMP32_O) $(ZSTD_FILES) $(ZSTDLEGACY_FILES) $(ZDICT_FILES) \
|
||||
$(CC) -m32 $(FLAGS) -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) $^ $(RES32_FILE) -o $@$(EXT)
|
||||
|
||||
|
||||
zstd_nolegacy :
|
||||
zstd_nolegacy : clean_decomp_o
|
||||
$(MAKE) zstd ZSTD_LEGACY_SUPPORT=0
|
||||
|
||||
zstd-pgo : MOREFLAGS = -fprofile-generate
|
||||
@ -108,18 +108,19 @@ zstd-pgo : clean zstd
|
||||
$(MAKE) zstd MOREFLAGS=-fprofile-use
|
||||
|
||||
zstd-frugal: $(ZSTDDECOMP_O) $(ZSTD_FILES) zstdcli.c fileio.c
|
||||
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_LEGACY_SUPPORT=0 $^ -o zstd$(EXT)
|
||||
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT $^ -o zstd$(EXT)
|
||||
|
||||
zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) \
|
||||
zstdcli.c fileio.c
|
||||
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT)
|
||||
zstd-small: clean_decomp_o
|
||||
ZSTD_LEGACY_SUPPORT=0 CFLAGS="-Os -s" $(MAKE) zstd-frugal
|
||||
|
||||
zstd-decompress: $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) \
|
||||
zstdcli.c fileio.c
|
||||
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOCOMPRESS -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT)
|
||||
zstd-decompress-clean: $(ZSTDDECOMP_O) $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) zstdcli.c fileio.c
|
||||
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOCOMPRESS $^ -o zstd-decompress$(EXT)
|
||||
|
||||
zstd-small: clean
|
||||
CFLAGS="-Os -s" $(MAKE) zstd-frugal
|
||||
zstd-decompress: clean_decomp_o
|
||||
ZSTD_LEGACY_SUPPORT=0 $(MAKE) zstd-decompress-clean
|
||||
|
||||
zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) zstdcli.c fileio.c
|
||||
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS $^ -o $@$(EXT)
|
||||
|
||||
|
||||
clean:
|
||||
@ -130,6 +131,10 @@ clean:
|
||||
*.gcda default.profraw
|
||||
@echo Cleaning completed
|
||||
|
||||
clean_decomp_o:
|
||||
@$(RM) $(ZSTDDECOMP_O)
|
||||
@$(RM) $(ZSTDDECOMP32_O)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------------
|
||||
#make install is validated only for Linux, OSX, kFreeBSD, Hurd and some BSD targets
|
||||
|
@ -231,7 +231,8 @@ int main(int argCount, const char* argv[])
|
||||
/* init */
|
||||
(void)recursive; (void)cLevelLast; /* not used when ZSTD_NOBENCH set */
|
||||
(void)dictCLevel; (void)dictSelect; (void)dictID; /* not used when ZSTD_NODICT set */
|
||||
(void)decode; (void)cLevel; /* not used when ZSTD_NOCOMPRESS set */
|
||||
(void)decode; (void)cLevel; (void)testmode;/* not used when ZSTD_NOCOMPRESS set */
|
||||
(void)ultra; /* not used when ZSTD_NODECOMPRESS set */
|
||||
if (filenameTable==NULL) { DISPLAY("zstd: %s \n", strerror(errno)); exit(1); }
|
||||
filenameTable[0] = stdinmark;
|
||||
displayOut = stderr;
|
||||
@ -490,12 +491,14 @@ int main(int argCount, const char* argv[])
|
||||
CLEAN_RETURN(filenameIdx);
|
||||
}
|
||||
|
||||
#ifndef ZSTD_NOCOMPRESS
|
||||
/* check compression level limits */
|
||||
{ int const maxCLevel = ultra ? ZSTD_maxCLevel() : ZSTDCLI_CLEVEL_MAX;
|
||||
if (cLevel > maxCLevel) {
|
||||
DISPLAYLEVEL(2, "Warning : compression level higher than max, reduced to %i \n", maxCLevel);
|
||||
cLevel = maxCLevel;
|
||||
} }
|
||||
#endif
|
||||
|
||||
/* No warning message in pipe mode (stdin + stdout) or multi-files mode */
|
||||
if (!strcmp(filenameTable[0], stdinmark) && outFileName && !strcmp(outFileName,stdoutmark) && (displayLevel==2)) displayLevel=1;
|
||||
|
Loading…
Reference in New Issue
Block a user