c - 尝试 makefile 时出错?

标签 c bash shell makefile

我下载了the NIST (Pseudo)randomness Test Suite并试图在我的 Mac OS 终端中./makefile它。但是,我遇到了以下错误消息。

v1020-wn-236-94:sts-2.1 Eric$ ./makefile
clang: error: no such file or directory: '='
./makefile: line 2: GCCFLAGS: command not found
./makefile: line 3: ROOTDIR: command not found
./makefile: line 4: ROOTDIR: command not found
./makefile: line 4: SRCDIR: command not found
./makefile: line 5: ROOTDIR: command not found
./makefile: line 5: OBJDIR: command not found
./makefile: line 6: VPATH: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJ: command not found
./makefile: line 18: OBJ: command not found
./makefile: line 18: assess:: command not found
clang: error: no input files
./makefile: line 19: OBJ: command not found
./makefile: line 19: -o: command not found
./makefile: line 21: OBJDIR: command not found
./makefile: line 21: SRCDIR: command not found
./makefile: line 21: /assess.o:: No such file or directory
clang: error: no input files
./makefile: line 22: SRCDIR: command not found
./makefile: line 22: -o: command not found
./makefile: line 24: OBJDIR: command not found
./makefile: line 24: SRCDIR: command not found
./makefile: line 24: /frequency.o:: No such file or directory
clang: error: no input files
./makefile: line 25: GCCFLAGS: command not found
./makefile: line 25: SRCDIR: command not found
./makefile: line 25: -o: command not found
./makefile: line 27: OBJDIR: command not found
./makefile: line 27: SRCDIR: command not found
./makefile: line 27: /blockFrequency.o:: No such file or directory
clang: error: no input files
./makefile: line 28: GCCFLAGS: command not found
./makefile: line 28: SRCDIR: command not found
./makefile: line 28: -o: command not found
./makefile: line 30: OBJDIR: command not found
./makefile: line 30: SRCDIR: command not found
./makefile: line 30: /cusum.o:: No such file or directory
clang: error: no input files
./makefile: line 31: GCCFLAGS: command not found
./makefile: line 31: SRCDIR: command not found
./makefile: line 31: -o: command not found
./makefile: line 33: OBJDIR: command not found
./makefile: line 33: SRCDIR: command not found
./makefile: line 33: /runs.o:: No such file or directory
clang: error: no input files
./makefile: line 34: GCCFLAGS: command not found
./makefile: line 34: SRCDIR: command not found
./makefile: line 34: -o: command not found
./makefile: line 36: OBJDIR: command not found
./makefile: line 36: SRCDIR: command not found
./makefile: line 36: /longestRunOfOnes.o:: No such file or directory
clang: error: no input files
./makefile: line 37: GCCFLAGS: command not found
./makefile: line 37: SRCDIR: command not found
./makefile: line 37: -o: command not found
./makefile: line 39: OBJDIR: command not found
./makefile: line 39: SRCDIR: command not found
./makefile: line 39: /rank.o:: No such file or directory
clang: error: no input files
./makefile: line 40: GCCFLAGS: command not found
./makefile: line 40: SRCDIR: command not found
./makefile: line 40: -o: command not found
./makefile: line 42: OBJDIR: command not found
./makefile: line 42: SRCDIR: command not found
./makefile: line 42: /discreteFourierTransform.o:: No such file or directory
clang: error: no input files
./makefile: line 44: GCCFLAGS: command not found
./makefile: line 44: SRCDIR: command not found
./makefile: line 44: -o: command not found
./makefile: line 47: OBJDIR: command not found
./makefile: line 47: SRCDIR: command not found
./makefile: line 47: /nonOverlappingTemplateMatchings.o:: No such file or directory
clang: error: no input files
./makefile: line 48: GCCFLAGS: command not found
./makefile: line 48: SRCDIR: command not found
./makefile: line 48: -o: command not found
./makefile: line 51: OBJDIR: command not found
./makefile: line 51: SRCDIR: command not found
./makefile: line 51: /overlappingTemplateMatchings.o:: No such file or directory
clang: error: no input files
./makefile: line 52: GCCFLAGS: command not found
./makefile: line 52: SRCDIR: command not found
./makefile: line 52: -o: command not found
./makefile: line 54: OBJDIR: command not found
./makefile: line 54: SRCDIR: command not found
./makefile: line 54: /universal.o:: No such file or directory
clang: error: no input files
./makefile: line 55: GCCFLAGS: command not found
./makefile: line 55: SRCDIR: command not found
./makefile: line 55: -o: command not found
./makefile: line 57: OBJDIR: command not found
./makefile: line 57: SRCDIR: command not found
./makefile: line 57: /approximateEntropy.o:: No such file or directory
clang: error: no input files
./makefile: line 58: GCCFLAGS: command not found
./makefile: line 58: SRCDIR: command not found
./makefile: line 58: -o: command not found
./makefile: line 60: OBJDIR: command not found
./makefile: line 60: SRCDIR: command not found
./makefile: line 60: /randomExcursions.o:: No such file or directory
clang: error: no input files
./makefile: line 61: GCCFLAGS: command not found
./makefile: line 61: SRCDIR: command not found
./makefile: line 61: -o: command not found
./makefile: line 63: OBJDIR: command not found
./makefile: line 63: SRCDIR: command not found
./makefile: line 63: /randomExcursionsVariant.o:: No such file or directory
clang: error: no input files
./makefile: line 64: GCCFLAGS: command not found
./makefile: line 64: SRCDIR: command not found
./makefile: line 64: -o: command not found
./makefile: line 66: OBJDIR: command not found
./makefile: line 66: SRCDIR: command not found
./makefile: line 66: /serial.o:: No such file or directory
clang: error: no input files
./makefile: line 67: GCCFLAGS: command not found
./makefile: line 67: SRCDIR: command not found
./makefile: line 67: -o: command not found
./makefile: line 69: OBJDIR: command not found
./makefile: line 69: SRCDIR: command not found
./makefile: line 69: /linearComplexity.o:: No such file or directory
clang: error: no input files
./makefile: line 70: GCCFLAGS: command not found
./makefile: line 70: SRCDIR: command not found
./makefile: line 70: -o: command not found
./makefile: line 72: OBJDIR: command not found
./makefile: line 72: SRCDIR: command not found
./makefile: line 72: /dfft.o:: No such file or directory
clang: error: no input files
./makefile: line 73: GCCFLAGS: command not found
./makefile: line 73: SRCDIR: command not found
./makefile: line 73: -o: command not found
./makefile: line 75: OBJDIR: command not found
./makefile: line 75: SRCDIR: command not found
./makefile: line 75: /matrix.o:: No such file or directory
clang: error: no input files
./makefile: line 76: GCCFLAGS: command not found
./makefile: line 76: SRCDIR: command not found
./makefile: line 76: -o: command not found
./makefile: line 78: OBJDIR: command not found
./makefile: line 78: SRCDIR: command not found
./makefile: line 78: /genutils.o:: No such file or directory
clang: error: no input files
./makefile: line 79: GCCFLAGS: command not found
./makefile: line 79: SRCDIR: command not found
./makefile: line 79: -o: command not found
./makefile: line 81: OBJDIR: command not found
./makefile: line 81: SRCDIR: command not found
./makefile: line 81: /cephes.o:: No such file or directory
clang: error: no input files
./makefile: line 82: GCCFLAGS: command not found
./makefile: line 82: SRCDIR: command not found
./makefile: line 82: -o: command not found
./makefile: line 84: OBJDIR: command not found
./makefile: line 84: SRCDIR: command not found
./makefile: line 84: /utilities.o:: No such file or directory
clang: error: no input files
./makefile: line 85: GCCFLAGS: command not found
./makefile: line 85: SRCDIR: command not found
./makefile: line 85: -o: command not found
./makefile: line 87: OBJDIR: command not found
./makefile: line 87: SRCDIR: command not found
./makefile: line 87: /generators.o:: No such file or directory
clang: error: no input files
./makefile: line 89: GCCFLAGS: command not found
./makefile: line 89: SRCDIR: command not found
./makefile: line 89: -o: command not found
./makefile: line 91: clean:: command not found
./makefile: line 92: OBJDIR: command not found
./makefile: line 94: rebuild:: command not found

我相信我有正确的 gcc 目录和 ROOTDIR。我的makefile文件如下。

CC = /usr/bin/gcc
GCCFLAGS = -c -Wall
ROOTDIR = /Users/Eric/Desktop/sts-2.1
SRCDIR = $(ROOTDIR)/src
OBJDIR = $(ROOTDIR)/obj
VPATH  = src:obj:include

OBJ = $(OBJDIR)/assess.o $(OBJDIR)/frequency.o $(OBJDIR)/blockFrequency.o \
      $(OBJDIR)/cusum.o $(OBJDIR)/runs.o $(OBJDIR)/longestRunOfOnes.o \
      $(OBJDIR)/serial.o $(OBJDIR)/rank.o $(OBJDIR)/discreteFourierTransform.o \
      $(OBJDIR)/nonOverlappingTemplateMatchings.o \
      $(OBJDIR)/overlappingTemplateMatchings.o $(OBJDIR)/universal.o \
      $(OBJDIR)/approximateEntropy.o $(OBJDIR)/randomExcursions.o \
      $(OBJDIR)/randomExcursionsVariant.o $(OBJDIR)/linearComplexity.o \
      $(OBJDIR)/dfft.o $(OBJDIR)/cephes.o $(OBJDIR)/matrix.o \
      $(OBJDIR)/utilities.o $(OBJDIR)/generators.o $(OBJDIR)/genutils.o

assess: $(OBJ)
    $(CC) -o $@ $(OBJ) -lm

$(OBJDIR)/assess.o: $(SRCDIR)/assess.c defs.h decls.h utilities.h
    $(CC) -o $@ -c $(SRCDIR)/assess.c

$(OBJDIR)/frequency.o: $(SRCDIR)/frequency.c defs.h externs.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/frequency.c

$(OBJDIR)/blockFrequency.o: $(SRCDIR)/blockFrequency.c defs.h externs.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/blockFrequency.c

$(OBJDIR)/cusum.o: $(SRCDIR)/cusum.c defs.h externs.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/cusum.c

$(OBJDIR)/runs.o: $(SRCDIR)/runs.c defs.h externs.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/runs.c

$(OBJDIR)/longestRunOfOnes.o: $(SRCDIR)/longestRunOfOnes.c defs.h externs.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/longestRunOfOnes.c

$(OBJDIR)/rank.o: $(SRCDIR)/rank.c defs.h externs.h matrix.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/rank.c

$(OBJDIR)/discreteFourierTransform.o: $(SRCDIR)/discreteFourierTransform.c \
        defs.h externs.h utilities.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/discreteFourierTransform.c

$(OBJDIR)/nonOverlappingTemplateMatchings.o: \
        $(SRCDIR)/nonOverlappingTemplateMatchings.c defs.h externs.h utilities.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/nonOverlappingTemplateMatchings.c

$(OBJDIR)/overlappingTemplateMatchings.o: \
        $(SRCDIR)/overlappingTemplateMatchings.c defs.h externs.h utilities.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/overlappingTemplateMatchings.c

$(OBJDIR)/universal.o: $(SRCDIR)/universal.c defs.h externs.h utilities.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/universal.c

$(OBJDIR)/approximateEntropy.o: $(SRCDIR)/approximateEntropy.c defs.h externs.h utilities.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/approximateEntropy.c

$(OBJDIR)/randomExcursions.o: $(SRCDIR)/randomExcursions.c defs.h externs.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/randomExcursions.c

$(OBJDIR)/randomExcursionsVariant.o: $(SRCDIR)/randomExcursionsVariant.c defs.h externs.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/randomExcursionsVariant.c

$(OBJDIR)/serial.o: $(SRCDIR)/serial.c defs.h externs.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/serial.c

$(OBJDIR)/linearComplexity.o: $(SRCDIR)/linearComplexity.c defs.h externs.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/linearComplexity.c

$(OBJDIR)/dfft.o: $(SRCDIR)/dfft.c
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/dfft.c

$(OBJDIR)/matrix.o: $(SRCDIR)/matrix.c defs.h externs.h utilities.h matrix.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/matrix.c

$(OBJDIR)/genutils.o: $(SRCDIR)/genutils.c config.h genutils.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/genutils.c

$(OBJDIR)/cephes.o: $(SRCDIR)/cephes.c cephes.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/cephes.c

$(OBJDIR)/utilities.o: $(SRCDIR)/utilities.c defs.h externs.h utilities.h config.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/utilities.c

$(OBJDIR)/generators.o: $(SRCDIR)/generators.c defs.h externs.h utilities.h \
        config.h generators.h
    $(CC) -o $@ $(GCCFLAGS) $(SRCDIR)/generators.c

clean:
    rm -f assess $(OBJDIR)/*.o

rebuild: clean assess

我该如何解决这个问题并继续?

最佳答案

查看此make tutorial 。它解释了有关 make 实用程序的所有内容以及它如何根据 makefile 中定义的依赖项和规则进行编译。

关于c - 尝试 makefile 时出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22364179/

相关文章:

c - 从以太网分割数据

c - 读一段c语言

在C中计算弧度的正弦

bash - 在 bash 中提高到非整数指数?

java - 在linux上编译运行HelloWorld.java

c - 如何理解char *fptr = NULL, *field;的含义?

linux - 通过输入重定向 (<) 将参数传递给 Bash Shell 脚本

linux - 根据文件类型选择文件提取方法 - tar.bz2、tar.gz、tar.xz

Fortran 代码的 Bash 包装器

linux - Bash 脚本 - 卸载一个设备,但如果没有安装它不会失败?