我有下面的makefile。例如,如果我做make USE_44=1 USE_O=1
,我收到以下錯誤。這個Makefile有什麼問題
makefile:21: *** missing separator
,其中第21行是elif ($(USE_S), 1)
。
請注意,如果我做make USE_44=1
,它編譯罰款。
有人可以告訴我這裏有什麼問題,我該如何解決?
USE_44 = 0
USE_IO = 0
USE_O = 0
USE_S = 0
USE_F = 0
USE_I = 0
USE_WL = 0
ifeq ($(USE_44), 0)
CXX = g++
else
CXX = g++44
endif
CXXFILES = main.cpp jacobcalc.cpp linkup.cpp slave1.cpp jacobcalc2.cpp slave2.cpp laplacalc.cpp multi.cpp subblock.cpp replication.cpp hash.cpp
CXXFLAGS := -std=c++0x -O3 -o
ifeq ($(USE_O), 1)
CXXFLAGS += progo -DWITHOUT_LOCKS -DWITHOUT_BARRIERS -DWITHOUT_MPROTECT
elif ($(USE_S), 1)
CXXFLAGS += progs -DWITHOUT_LOCKS -DWITHOUT_BARRIERS -DWITHOUT_MPROTECT -DSINGLE
elif ($(USE_F), 1)
CXXFLAGS += progf -DNEGLECT_DET_LOCKS
elif ($(USE_I), 1)
CXXFLAGS += progi -DWITH_INSTR
elif ($(USE_WL), 1)
CXXFLAGS += progwl -DWITHOUT_LOCKS
else
CXXFLAGS += prog
endif
ifeq ($(USE_IO), 1)
CXXFLAGS += -DWITHOUT_IO
endif
#CFLAGS := $(CFLAGS) -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wdisabled-optimization
#CFLAGS := $(CFLAGS) -Wpadded -Winline -Wpointer-arith -Wsign-compare -Wendif-labels prog
LIBS := -lm -lpthread
all:
$(CXX) $(CXXFILES) $(LIBS) $(CXXFLAGS)
clean:
rm -f prog* *.o