当我尝试在 make 文件中创建库时,我收到 gcc: error: libs1.a: No such file or directory 错误。我不知道我哪里错了。库命令是 write 因为我尝试了故障排除并独立运行了命令并创建了库。生成文件如下......
COMPILER = gcc
CCFLAGS = -Wall
all:search
debug:
make DEBUG=TRUE
search.o: search.c tokenizer.h uthash.h
$(COMPILER) $(CCFLAGS) -c search.c
tokenizer.o: tokenizer.c
$(COMPILER) $(CCFLAGS) -c tokenizer.c
libs1.a: tokenizer.o search.o
ar -cvq libs1.a search.o tokenizer.o
search: search.o tokenizer.o
$(COMPILER) $(CCFLAGS) -o search search.o libs1.a
ifeq ($(DEBUG), TRUE)
CCFLAGS += -g
endif
clean:
rm -f *.o
rm -f *.a libs1