拂晓·明月·弯刀

观望,等待只能让出现的机会白白溜走

  C++博客 :: 首页 ::  :: 联系 :: 聚合  :: 管理 ::

以下是本人在GNUStep环境下写的Makfile文件总结:

  1. 执行语句前不要有空格,最好以TAB代替空格
  2. 变量使用方式是$(CC),而不是$CC,%CC%等形式

附Makefile文件内容:

CC=gcc
CFLAGS=-fconstant-string-class=NSConstantString -I/GNUStep/System/Library/Headers
CLIBRARY=-L/GNUStep/System/Library/Libraries/ -lobjc -lgnustep-base

Main: Main.o Shape.o CarParts.o Engine.o Tire.o Slant.o AllWeatherRadial.o
$(CC) -o Main Main.o Shape.o CarParts.o Engine.o Tire.o Slant.o AllWeatherRadial.o $(CLIBRARY)

Main.o: Test.m Shape.h Engine.h Tire.h AllWeatherRadial.h Slant.h CarParts.h
$(CC) -o Main.o -c Test.m $(CFLAGS) -std=c99

Shape.o: Shape.m Shape.h
$(CC) -c Shape.m $(CFLAGS) -std=c99

CarParts.o: CarParts.m CarParts.h Engine.h Tire.h
$(CC) -c CarParts.m $(CFLAGS) -std=c99

Engine.o: Engine.m Engine.h
$(CC) -c Engine.m $(CFLAGS)

Tire.o: Tire.m Tire.h
$(CC) -c Tire.m $(CFLAGS)

Slant.o: Slant.m Slant.h Engine.h
$(CC) -c Slant.m $(CFLAGS)

AllWeatherRadial.o: AllWeatherRadial.m AllWeatherRadial.h Tire.h
$(CC) -c AllWeatherRadial.m $(CFLAGS)

clean:
rm -f *.o
rm -f Main.exe

posted on 2009-12-29 22:14 一路风尘 阅读(244) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理