作者 Anonymous [actionscript] 2012-10-29 14:11 (点击下载)

  1. CC=gcc
  2. CFLAGS=-Wall -Wextra -std=gnu99 -O2 -Wno-pointer-to-int-cast
  3. CXXFLAGS=`pkg-config opencv --cflags` -std=c++0x
  4. LDLIBS=-lbcm2835 -lrt `pkg-config opencv --libs`
  5. ELFS=tft_test cv_test
  6. OBJS:=spi.o tft_test.o tft_frontend.o tft_backend.o cv_test.o
  7.  
  8. # compile and generate dependency info;
  9. # more complicated dependency computation, so all prereqs listed
  10. # will also become command-less, prereq-less targets
  11. # sed: strip the target (everything before colon)
  12. # sed: remove any continuation backslashes
  13. # fmt -1: list words one per line
  14. # sed: strip leading spaces
  15. # sed: add trailing colons
  16. %.o: %.c
  17. gcc -c $(CFLAGS) $*.c -o $*.o
  18. gcc -MM $(CFLAGS) $*.c > $*.d
  19. @cp -f $*.d $*.d.tmp
  20. @sed -e 's/.*://' -e 's/\$$//' < $*.d.tmp | fmt -1 |
  21. sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
  22. @rm -f $*.d.tmp
  23.  
  24. %.o: %.cpp
  25. g++ -c $(CXXFLAGS) $*.cpp -o $*.o
  26. g++ -MM $(CXXFLAGS) $*.cpp > $*.d
  27. @cp -f $*.d $*.d.tmp
  28. @sed -e 's/.*://' -e 's/\$$//' < $*.d.tmp | fmt -1 |
  29. sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
  30. @rm -f $*.d.tmp
  31. tft_test:spi.o tft_test.o
  32. $(CC) spi.o tft_test.o -o tft_test $(LDLIBS)
  33. cv_test:$(OBJS)
  34. $(CXX) $(CXXFLAGS) -o cv_test $(OBJS) $(LDLIBS)
  35. .PHONY:clean
  36. clean:
  37. rm -f *.o *.s *.i $(ELFS) *.d

提交下面的校正或者修改. (点击这里开始一个新的帖子)
姓名: 在 cookie 中记住我的名字

屏幕抓图:(jpeg 或 png)