mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2024-11-28 07:23:07 +01:00
Minor
This commit is contained in:
parent
93cbb7c375
commit
5ef3f4ff48
18
Makefile
18
Makefile
@ -12,7 +12,7 @@ O := -O2
|
||||
LIBS := magic crypto
|
||||
|
||||
CFLAGS += $(O) -MD -Wall -Wextra -Wno-unused-parameter
|
||||
LDFLAGS += $(LIBS:%=-l%)
|
||||
LDFLAGS += $(addprefix -l,$(LIBS))
|
||||
|
||||
all: ctpv
|
||||
|
||||
@ -42,9 +42,6 @@ docs: README.md doc/ctpv.1
|
||||
./deplist.awk $(PRE) | ./deplist.md.sh | ./deplistadd.sh README.md
|
||||
./deplist.awk $(PRE) | ./deplist.1.sh | ./deplistadd.sh doc/ctpv.1
|
||||
|
||||
make_embed:
|
||||
$(MAKE) -C embed
|
||||
|
||||
ctpv: $(OBJ)
|
||||
$(CC) -o $@ $+ $(LDFLAGS)
|
||||
|
||||
@ -54,22 +51,25 @@ src/shell.c: gen/helpers.h
|
||||
src/server.c: gen/server.h
|
||||
|
||||
gen/previews.h: $(PRE) embed/embed
|
||||
@mkdir -p $(@D)
|
||||
embed/embed -p prev_scr_ $(PRE) > $@
|
||||
|
||||
gen/server.h: sh/clear.sh sh/end.sh embed/embed
|
||||
@mkdir -p $(@D)
|
||||
embed/embed -p scr_ sh/clear.sh sh/end.sh > $@
|
||||
|
||||
gen/helpers.h: sh/helpers.sh embed/embed
|
||||
@mkdir -p $(@D)
|
||||
embed/embed -p scr_ sh/helpers.sh > $@
|
||||
|
||||
embed/embed: make_embed ;
|
||||
$(GEN): | gen
|
||||
|
||||
gen:
|
||||
mkdir $@
|
||||
|
||||
embed/embed: .force
|
||||
$(MAKE) -C embed
|
||||
|
||||
-include $(DEP)
|
||||
|
||||
.PHONY: all options install install.bin install.man uninstall \
|
||||
clean docs make_embed
|
||||
clean docs .force
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
|
@ -112,7 +112,7 @@ static inline void file_access_err(char *f, int errno_)
|
||||
print_errorf("failed to access '%s': %s", f, strerror(errno_));
|
||||
}
|
||||
|
||||
static int get_input_file(char *f, struct InputFile *input_f)
|
||||
static int get_input_file(struct InputFile *input_f, char *f)
|
||||
{
|
||||
if (!f) {
|
||||
print_error("file not given");
|
||||
@ -216,7 +216,7 @@ static int preview(int argc, char *argv[])
|
||||
ERRCHK_RET_OK(init_previews());
|
||||
|
||||
struct InputFile input_f;
|
||||
ERRCHK_RET_OK(get_input_file(f, &input_f));
|
||||
ERRCHK_RET_OK(get_input_file(&input_f, f));
|
||||
|
||||
if (!ctpv.opts.nosymlinkinfo && *input_f.link) {
|
||||
printf("\033[1;36mSymlink points to:\033[m\n\t%s\n\n", input_f.link);
|
||||
@ -351,7 +351,7 @@ static int mime(int argc, char *argv[])
|
||||
ERRCHK_RET_OK(init_magic());
|
||||
|
||||
for (int i = 0; i < argc; i++) {
|
||||
ERRCHK_RET_OK(get_input_file(argv[i], &input_f));
|
||||
ERRCHK_RET_OK(get_input_file(&input_f, argv[i]));
|
||||
|
||||
mimetype = get_mimetype(input_f.path);
|
||||
ERRCHK_RET(!mimetype);
|
||||
|
Loading…
Reference in New Issue
Block a user