首页 > 解决方案 > Makefile 文件无法识别:文件格式无法识别

问题描述

首先,我从来没有使用过 Makefile,所以我在这里太过分了。我正在尝试重写 XROTOR 代码的一小部分(我所做的只是更新绘图脚本,以便打印出带有附加数据的文件 - 在 jplot.f 中)

我采用了主要的 XROTOR Makefile 并删除了额外的程序,因此只创建了 jplot.exe。

我正在使用 MinGW 运行 Makefile(我在下面包含),并且我得到了大量以以下错误结尾的输出字符串:

../plotlib/libPlt.a -lgdi32 -Bstatic -lgfortran -Bdynamic -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt --as-needed -lquadmath --no-as-needed -lm -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt z:/mingw/bin/../lib/gcc/mingw32/6.3.0/crtend.o
jplot.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
Makefile:52: recipe for target 'jplot' failed
#*********************************************************
# Makefile for XROTOR Version 6.80
# M.Drela
# H.Youngren 11/28/98
#*********************************************************
# crotor, espara, esprop targets added
# PJC, Esotec Developments, 18 July 2011
# esloft, eslplots, esxfsubs targets added Aug 2011
#*********************************************************
PLTLIB = ../plotlib/libPlt.a
#PLTLIB = ../plotlib/libPltDP.a

SRC = ../src

##--------------------------
## mingw  gfortran
#BDIR = d:\gcc452\bin
#FC = $(BDIR)\gfortran.exe
#CC  = $(BDIR)\gfortran.exe 
FC = gfortran
CC = gfortran
DP =
FFLAGS  = -O -pipe $(DP)
CFLAGS  = -O -pipe
#AR = $(BDIR)\ar.exe r
#RANLIB = $(BDIR)\ranlib.exe 
AR = ar r
RANLIB = ranlib
LINKLIB = -lgdi32
LFLAGS = -Wl,--strip-debug  -static-libgfortran -static-libgcc 
LIBS =
###================================================

PROGS = jplot
#PROGS = xrotor

JPLOTOBJS  = jplot.o xutils.o jputil.o userio.o

all:     $(PROGS)

install: 
    $(INSTALLCMD) $(PROGS) $(BINDIR)

clean:
    -/bin/rm *.o
    -/bin/rm $(PROGS)
    -/bin/rm plot.ps


### Make targets
jplot: $(JPLOTOBJS)
    $(FC) -v -o jplot.exe  $(LFLAGS) $(JPLOTOBJS) $(PLTLIB) $(LINKLIB)

xutils.o: $(SRC)/xutils.f
    $(FC) -c -I$(SRC) $(FFLAGS) $(SRC)/xutils.f
userio.o: $(SRC)/userio.f
    $(FC) -c -I$(SRC) $(FFLAGS) $(SRC)/userio.f
jplot.o: $(SRC)/jplot.f
    $(FC) -c -I$(SRC) -std=legacy $(FFLAGS) $(SRC)/jplot.f
jputil.o: $(SRC)/jputil.f
    $(FC) -c -I$(SRC) $(FFLAGS) $(SRC)/jputil.f

任何人都可以提供的任何帮助将不胜感激!如果我没有提供足够的信息,请告诉我!

标签: makefilemingw

解决方案


推荐阅读