我正在使用这个通用的 makefile。
使用此自定义选项:
# The pre-processor options used by the cpp (man cpp for more).
CPPFLAGS = -Wall -I/Library/Frameworks/SDL.framework/Headers
# The options used in linking as well as in any direct use of ld.
LDFLAGS = -framework SDL -framework Cocoa -framework OpenGL
# The executable file name.
# If not specified, current directory name or `a.out' will be used.
PROGRAM = app
# The source file types (headers excluded).
# .c indicates C source files, and others C++ ones.
SRCEXTS = .c .C .cc .cpp .CPP .c++ .cxx .cp .m
clean:
$(RM) $(OBJS) $(PROGRAM) $(PROGRAM)
代替:
# The pre-processor options used by the cpp (man cpp for more).
CPPFLAGS = -Wall
# The options used in linking as well as in any direct use of ld.
LDFLAGS =
# The executable file name.
# If not specified, current directory name or `a.out' will be used.
PROGRAM =
# The source file types (headers excluded).
# .c indicates C source files, and others C++ ones.
SRCEXTS = .c .C .cc .cpp .CPP .c++ .cxx .cp
clean:
$(RM) $(OBJS) $(PROGRAM) $(PROGRAM).exe
在这里你可以找到我正在运行的 makefile 的完整版本。
我正在使用带有 gcc 4.2.1 的 Mac OS X 10.6.8,并尝试使用main.cpp
SDL和 OpenGL 进行编译。SDLMain.m
SDLMain.h
弹出的错误是:
main.d:1: *缺少分隔符。停止。
并且文件 main.d(由 makefile 生成)是这样的:
-n ./
main.o: main.cpp
有什么问题?