这是我在 UNIX 上运行的 C++ Makefile:
# This is a Makefile for the SocNetwork project
CCC = g++
CXXFLAGS = -Wall -g
CXXLINK = $(CCC)
OBJS = Message.o Date.o main.o SocialNetwork.o User.o
RM enter code here= rm -f
all: SocNetwork
# Creating the executable (SocNetwork)
SocNetwork: $(OBJS)
$(CXXLINK) -o SocNetwork $(OBJS)
# Creating object files using default rules
Date.o: Date.C Date.H
main.o: main.C SocialNetwork.H User.H defs.H Date.H Message.H
Message.o: Message.C Message.H defs.H
SocialNetwork.o: SocialNetwork.C SocialNetwork.H User.H defs.H Date.H Message.H
User.o: User.C User.H defs.H Date.H Message.H
# Cleaning old files before new make
clean:
$(RM) SocNetwork screen_test *.o *.bak *~ "#"* core
当我在 UNIX 中运行 makefile 时,我得到:
./makefile: line 2: CCC: command not found
./makefile: line 3: CXXFLAGS: command not found
./makefile: line 4: CCC: command not found
./makefile: line 4: CXXLINK: command not found
./makefile: line 5: OBJS: command not found
./makefile: line 6: RM: command not found
./makefile: line 7: all:: command not found
./makefile: line 9: OBJS: command not found
./makefile: line 9: SocNetwork:: command not found
./makefile: line 10: CXXLINK: command not found
./makefile: line 10: OBJS: command not found
./makefile: line 10: -o: command not found
./makefile: line 12: Date.o:: command not found
./makefile: line 13: main.o:: command not found
./makefile: line 14: Message.o:: command not found
./makefile: line 15: SocialNetwork.o:: command not found
./makefile: line 16: User.o:: command not found
./makefile: line 18: clean:: command not found
./makefile: line 19: RM: command not found
./makefile: line 19: SocNetwork: command not found
谁能告诉我我的makefile有什么问题?标签没有问题,我检查了。谢谢!!!