You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

497 lines
13KB

  1. #
  2. # "$Id: Makefile 8389 2011-02-06 14:08:08Z manolo $"
  3. #
  4. # Test/example program makefile for the Fast Light Tool Kit (FLTK).
  5. #
  6. # Copyright 1998-2010 by Bill Spitzak and others.
  7. #
  8. # This library is free software; you can redistribute it and/or
  9. # modify it under the terms of the GNU Library General Public
  10. # License as published by the Free Software Foundation; either
  11. # version 2 of the License, or (at your option) any later version.
  12. #
  13. # This library is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. # Library General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU Library General Public
  19. # License along with this library; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  21. # USA.
  22. #
  23. # Please report all bugs and problems on the following page:
  24. #
  25. # http://www.fltk.org/str.php
  26. #
  27. include ../makeinclude
  28. CPPFILES =\
  29. unittests.cxx \
  30. adjuster.cxx \
  31. arc.cxx \
  32. ask.cxx \
  33. bitmap.cxx \
  34. blocks.cxx \
  35. boxtype.cxx \
  36. browser.cxx \
  37. button.cxx \
  38. buttons.cxx \
  39. cairo_test.cxx \
  40. checkers.cxx \
  41. colbrowser.cxx \
  42. color_chooser.cxx \
  43. cube.cxx \
  44. CubeMain.cxx \
  45. CubeView.cxx \
  46. cursor.cxx \
  47. curve.cxx \
  48. demo.cxx \
  49. device.cxx \
  50. doublebuffer.cxx \
  51. editor.cxx \
  52. fast_slow.cxx \
  53. file_chooser.cxx \
  54. fonts.cxx \
  55. fractals.cxx \
  56. fullscreen.cxx \
  57. gl_overlay.cxx \
  58. glpuzzle.cxx \
  59. hello.cxx \
  60. help.cxx \
  61. iconize.cxx \
  62. image.cxx \
  63. inactive.cxx \
  64. input.cxx \
  65. input_choice.cxx \
  66. keyboard.cxx \
  67. label.cxx \
  68. line_style.cxx \
  69. list_visuals.cxx \
  70. mandelbrot.cxx \
  71. menubar.cxx \
  72. message.cxx \
  73. minimum.cxx \
  74. native-filechooser.cxx \
  75. navigation.cxx \
  76. output.cxx \
  77. overlay.cxx \
  78. pack.cxx \
  79. pixmap_browser.cxx \
  80. pixmap.cxx \
  81. preferences.cxx \
  82. device.cxx \
  83. radio.cxx \
  84. resizebox.cxx \
  85. resize.cxx \
  86. rotated_text.cxx \
  87. scroll.cxx \
  88. shape.cxx \
  89. subwindow.cxx \
  90. sudoku.cxx \
  91. symbols.cxx \
  92. table.cxx \
  93. tabs.cxx \
  94. threads.cxx \
  95. tile.cxx \
  96. tiled_image.cxx \
  97. tree.cxx \
  98. valuators.cxx \
  99. utf8.cxx
  100. ALL = \
  101. unittests$(EXEEXT) \
  102. adjuster$(EXEEXT) \
  103. arc$(EXEEXT) \
  104. ask$(EXEEXT) \
  105. bitmap$(EXEEXT) \
  106. blocks$(EXEEXT) \
  107. boxtype$(EXEEXT) \
  108. browser$(EXEEXT) \
  109. button$(EXEEXT) \
  110. buttons$(EXEEXT) \
  111. cairo_test$(EXEEXT) \
  112. checkers$(EXEEXT) \
  113. colbrowser$(EXEEXT) \
  114. color_chooser$(EXEEXT) \
  115. cursor$(EXEEXT) \
  116. curve$(EXEEXT) \
  117. demo$(EXEEXT) \
  118. device$(EXEEXT) \
  119. doublebuffer$(EXEEXT) \
  120. editor$(EXEEXT) \
  121. fast_slow$(EXEEXT) \
  122. file_chooser$(EXEEXT) \
  123. fonts$(EXEEXT) \
  124. hello$(EXEEXT) \
  125. help$(EXEEXT) \
  126. iconize$(EXEEXT) \
  127. image$(EXEEXT) \
  128. inactive$(EXEEXT) \
  129. input$(EXEEXT) \
  130. input_choice$(EXEEXT) \
  131. keyboard$(EXEEXT) \
  132. label$(EXEEXT) \
  133. line_style$(EXEEXT) \
  134. list_visuals$(EXEEXT) \
  135. mandelbrot$(EXEEXT) \
  136. menubar$(EXEEXT) \
  137. message$(EXEEXT) \
  138. minimum$(EXEEXT) \
  139. native-filechooser$(EXEEXT) \
  140. navigation$(EXEEXT) \
  141. output$(EXEEXT) \
  142. overlay$(EXEEXT) \
  143. pack$(EXEEXT) \
  144. pixmap$(EXEEXT) \
  145. pixmap_browser$(EXEEXT) \
  146. preferences$(EXEEXT) \
  147. device$(EXEEXT) \
  148. radio$(EXEEXT) \
  149. resize$(EXEEXT) \
  150. resizebox$(EXEEXT) \
  151. rotated_text$(EXEEXT) \
  152. scroll$(EXEEXT) \
  153. subwindow$(EXEEXT) \
  154. sudoku$(EXEEXT) \
  155. symbols$(EXEEXT) \
  156. table$(EXEEXT) \
  157. tabs$(EXEEXT) \
  158. $(THREADS) \
  159. tile$(EXEEXT) \
  160. tiled_image$(EXEEXT) \
  161. tree$(EXEEXT) \
  162. valuators$(EXEEXT) \
  163. cairotest$(EXEEXT) \
  164. utf8$(EXEEXT)
  165. GLALL = \
  166. cube$(EXEEXT) \
  167. CubeView$(EXEEXT) \
  168. fractals$(EXEEXT) \
  169. fullscreen$(EXEEXT) \
  170. gl_overlay$(EXEEXT) \
  171. glpuzzle$(EXEEXT) \
  172. shape$(EXEEXT)
  173. all: $(ALL) $(GLDEMOS)
  174. gldemos: $(GLALL)
  175. depend: $(CPPFILES)
  176. makedepend -Y -I.. -f makedepend $(CPPFILES)
  177. # Automatically generated dependencies...
  178. include makedepend
  179. clean:
  180. $(RM) $(ALL) $(GLALL) core
  181. $(RM) *.o core.* *~ *.bck *.bak
  182. $(RM) CubeViewUI.cxx CubeViewUI.h
  183. $(RM) fast_slow.cxx fast_slow.h
  184. $(RM) inactive.cxx inactive.h
  185. $(RM) keyboard_ui.cxx keyboard_ui.h
  186. $(RM) mandelbrot_ui.cxx mandelbrot_ui.h
  187. $(RM) preferences.cxx preferences.h
  188. $(RM) radio.cxx radio.h
  189. $(RM) resize.cxx resize.h
  190. $(RM) tabs.cxx tabs.h
  191. $(RM) tree.cxx tree.h
  192. $(RM) valuators.cxx valuators.h
  193. $(OSX_ONLY) $(RM) blocks.app/Contents/MacOS/blocks$(EXEEXT)
  194. $(OSX_ONLY) $(RM) checkers.app/Contents/MacOS/checkers$(EXEEXT)
  195. $(OSX_ONLY) $(RM) sudoku.app/Contents/MacOS/sudoku$(EXEEXT)
  196. install: all
  197. echo "Installing example programs to $(DESTDIR)$(docdir)/examples..."
  198. -$(INSTALL_DIR) $(DESTDIR)$(docdir)/examples
  199. for file in *.h *.cxx *.fl demo.menu; do \
  200. $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/examples; \
  201. done
  202. -$(INSTALL_DIR) $(DESTDIR)$(docdir)/examples/pixmaps
  203. for file in pixmaps/*.xbm pixmaps/*.xpm; do \
  204. $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/examples/pixmaps; \
  205. done
  206. install-linux:
  207. echo Installing games to $(DESTDIR)$(bindir)...
  208. -$(INSTALL_DIR) $(DESTDIR)$(bindir)
  209. -$(INSTALL_DIR) $(DESTDIR)/usr/share/applications
  210. -$(INSTALL_DIR) $(DESTDIR)/usr/share/icons/hicolor/32x32/apps
  211. -$(INSTALL_DIR) $(DESTDIR)/usr/share/icons/hicolor/128x128/apps
  212. for game in blocks checkers sudoku; do \
  213. $(INSTALL_BIN) $$game $(DESTDIR)$(bindir); \
  214. $(INSTALL_DATA) desktop/$$game.desktop $(DESTDIR)/usr/share/applications; \
  215. $(INSTALL_DATA) desktop/$$game-32.png $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/$$game.png; \
  216. $(INSTALL_DATA) desktop/$$game-128.png $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/$$game.png; \
  217. done
  218. install-osx:
  219. echo Installing games in $(DESTDIR)/Applications...
  220. for game in blocks checkers sudoku; do \
  221. if test ! -d $(DESTDIR)/Applications/$$game.app; then \
  222. $(INSTALL_DIR) $(DESTDIR)/Applications/$$game.app; \
  223. $(INSTALL_DIR) $(DESTDIR)/Applications/$$game.app/Contents; \
  224. $(INSTALL_DIR) $(DESTDIR)/Applications/$$game.app/Contents/MacOS; \
  225. $(INSTALL_DIR) $(DESTDIR)/Applications/$$game.app/Contents/Resources; \
  226. fi; \
  227. $(INSTALL_DATA) $$game.app/Contents/Info.plist $(DESTDIR)/Applications/$$game.app/Contents; \
  228. $(INSTALL_DATA) $$game.app/Contents/PkgInfo $(DESTDIR)/Applications/$$game.app/Contents; \
  229. $(INSTALL_BIN) $$game.app/Contents/MacOS/$$game $(DESTDIR)/Applications/$$game.app/Contents/MacOS; \
  230. $(INSTALL_DATA) $$game.app/Contents/Resources/$$game.icns $(DESTDIR)/Applications/$$game.app/Contents/Resources; \
  231. done
  232. uninstall:
  233. echo "Removing examples programs from $(DESTDIR)$(docdir)/examples..."
  234. -$(RMDIR) $(DESTDIR)$(docdir)/examples
  235. uninstall-linux:
  236. echo Removing games from $(DESTDIR)$(bindir)...
  237. for game in blocks checkers sudoku; do \
  238. $(RM) $(DESTDIR)$(bindir)/$$game; \
  239. $(RM) $(DESTDIR)/usr/share/applications/$$game.desktop; \
  240. $(RM) $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/$$game.png; \
  241. $(RM) $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/$$game.png; \
  242. done
  243. uninstall-osx:
  244. echo Removing games from $(DESTDIR)/Applications...
  245. $(RMDIR) $(DESTDIR)/Applications/blocks.app
  246. $(RMDIR) $(DESTDIR)/Applications/checkers.app
  247. $(RMDIR) $(DESTDIR)/Applications/sudoku.app
  248. # FLUID file rules
  249. .fl.cxx .fl.h: ../fluid/fluid$(EXEEXT)
  250. echo Generating $@ and header from $<...
  251. ../fluid/fluid$(EXEEXT) -c $<
  252. # All demos depend on the FLTK library...
  253. $(ALL): $(LIBNAME)
  254. # General demos...
  255. unittests$(EXEEXT): unittests.o
  256. unittests.cxx: unittest_about.cxx unittest_points.cxx unittest_lines.cxx unittest_circles.cxx \
  257. unittest_rects.cxx unittest_text.cxx unittest_viewport.cxx unittest_images.cxx
  258. adjuster$(EXEEXT): adjuster.o
  259. arc$(EXEEXT): arc.o
  260. ask$(EXEEXT): ask.o
  261. bitmap$(EXEEXT): bitmap.o
  262. boxtype$(EXEEXT): boxtype.o
  263. browser$(EXEEXT): browser.o
  264. button$(EXEEXT): button.o
  265. buttons$(EXEEXT): buttons.o
  266. blocks$(EXEEXT): blocks.o
  267. echo Linking $@...
  268. $(CXX) $(ARCHFLAGS) $(LDFLAGS) blocks.o -o $@ $(AUDIOLIBS) $(LINKFLTK) $(LDLIBS)
  269. $(OSX_ONLY) $(INSTALL_BIN) blocks$(EXEEXT) blocks.app/Contents/MacOS
  270. checkers$(EXEEXT): checkers.o
  271. echo Linking $@...
  272. $(CXX) $(ARCHFLAGS) $(LDFLAGS) checkers.o -o $@ $(LINKFLTK) $(LDLIBS)
  273. $(OSX_ONLY) $(INSTALL_BIN) checkers$(EXEEXT) checkers.app/Contents/MacOS
  274. colbrowser$(EXEEXT): colbrowser.o
  275. echo Linking $@...
  276. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ colbrowser.o $(LINKFLTKFORMS) $(LDLIBS)
  277. color_chooser$(EXEEXT): color_chooser.o
  278. cursor$(EXEEXT): cursor.o
  279. curve$(EXEEXT): curve.o
  280. demo$(EXEEXT): demo.o
  281. echo Linking $@...
  282. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ demo.o $(LINKFLTKFORMS) $(LDLIBS)
  283. device$(EXEEXT): device.o $(IMGLIBNAME)
  284. echo Linking $@...
  285. $(CXX) $(ARCHFLAGS) $(LDFLAGS) device.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
  286. doublebuffer$(EXEEXT): doublebuffer.o
  287. editor$(EXEEXT): editor.o
  288. echo Linking $@...
  289. $(CXX) $(ARCHFLAGS) $(LDFLAGS) editor.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
  290. fast_slow$(EXEEXT): fast_slow.o
  291. fast_slow.cxx: fast_slow.fl ../fluid/fluid$(EXEEXT)
  292. file_chooser$(EXEEXT): file_chooser.o $(IMGLIBNAME)
  293. echo Linking $@...
  294. $(CXX) $(ARCHFLAGS) $(LDFLAGS) file_chooser.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
  295. fonts$(EXEEXT): fonts.o
  296. hello$(EXEEXT): hello.o
  297. help$(EXEEXT): help.o $(IMGLIBNAME)
  298. echo Linking $@...
  299. $(CXX) $(ARCHFLAGS) $(LDFLAGS) help.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
  300. iconize$(EXEEXT): iconize.o
  301. image$(EXEEXT): image.o
  302. inactive$(EXEEXT): inactive.o
  303. inactive.cxx: inactive.fl ../fluid/fluid$(EXEEXT)
  304. input$(EXEEXT): input.o
  305. input_choice$(EXEEXT): input_choice.o
  306. keyboard$(EXEEXT): keyboard_ui.o keyboard.o
  307. echo Linking $@...
  308. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ keyboard.o keyboard_ui.o $(LINKFLTK) $(LDLIBS)
  309. keyboard_ui.o: keyboard_ui.h
  310. keyboard_ui.cxx: keyboard_ui.fl ../fluid/fluid$(EXEEXT)
  311. label$(EXEEXT): label.o
  312. echo Linking $@...
  313. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ label.o $(LINKFLTKFORMS) $(LDLIBS)
  314. line_style$(EXEEXT): line_style.o
  315. list_visuals$(EXEEXT): list_visuals.o
  316. mandelbrot$(EXEEXT): mandelbrot_ui.o mandelbrot.o
  317. echo Linking $@...
  318. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ mandelbrot.o mandelbrot_ui.o $(LINKFLTK) $(LDLIBS)
  319. mandelbrot_ui.o: mandelbrot_ui.h
  320. mandelbrot_ui.cxx: mandelbrot_ui.fl ../fluid/fluid$(EXEEXT)
  321. menubar$(EXEEXT): menubar.o
  322. message$(EXEEXT): message.o
  323. minimum$(EXEEXT): minimum.o
  324. native-filechooser$(EXEEXT): native-filechooser.o $(IMGLIBNAME)
  325. echo Linking $@...
  326. $(CXX) $(ARCHFLAGS) $(LDFLAGS) native-filechooser.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
  327. navigation$(EXEEXT): navigation.o
  328. output$(EXEEXT): output.o $(FLLIBNAME)
  329. echo Linking $@...
  330. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ output.o $(LINKFLTKFORMS) $(LDLIBS)
  331. overlay$(EXEEXT): overlay.o
  332. pack$(EXEEXT): pack.o
  333. pixmap$(EXEEXT): pixmap.o
  334. pixmap_browser$(EXEEXT): pixmap_browser.o $(IMGLIBNAME)
  335. echo Linking $@...
  336. $(CXX) $(ARCHFLAGS) $(LDFLAGS) pixmap_browser.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
  337. preferences$(EXEEXT): preferences.o
  338. preferences.cxx: preferences.fl ../fluid/fluid$(EXEEXT)
  339. device$(EXEEXT): device.o
  340. radio$(EXEEXT): radio.o
  341. radio.cxx: radio.fl ../fluid/fluid$(EXEEXT)
  342. resize$(EXEEXT): resize.o
  343. resize.cxx: resize.fl ../fluid/fluid$(EXEEXT)
  344. resizebox$(EXEEXT): resizebox.o
  345. rotated_text$(EXEEXT): rotated_text.o
  346. scroll$(EXEEXT): scroll.o
  347. subwindow$(EXEEXT): subwindow.o
  348. sudoku: sudoku.o
  349. echo Linking $@...
  350. $(CXX) $(ARCHFLAGS) $(LDFLAGS) sudoku.o -o $@ $(AUDIOLIBS) $(LINKFLTKIMG) $(LDLIBS)
  351. $(OSX_ONLY) $(INSTALL_BIN) sudoku$(EXEEXT) sudoku.app/Contents/MacOS
  352. sudoku.exe: sudoku.o sudoku.rc
  353. echo Linking $@...
  354. $(RC) sudoku.rc sudokures.o
  355. $(CXX) $(ARCHFLAGS) $(LDFLAGS) sudoku.o sudokures.o -o $@ $(AUDIOLIBS) $(LINKFLTKIMG) $(LDLIBS)
  356. symbols$(EXEEXT): symbols.o
  357. table$(EXEEXT): table.o
  358. tabs$(EXEEXT): tabs.o
  359. tabs.cxx: tabs.fl ../fluid/fluid$(EXEEXT)
  360. threads$(EXEEXT): threads.o
  361. # This ensures that we have this dependency even if threads are not
  362. # enabled in the current tree...
  363. threads.o: threads.h
  364. tile$(EXEEXT): tile.o
  365. tiled_image$(EXEEXT): tiled_image.o
  366. tree$(EXEEXT): tree.o
  367. tree.cxx: tree.fl ../fluid/fluid$(EXEEXT)
  368. valuators$(EXEEXT): valuators.o
  369. valuators.cxx: valuators.fl ../fluid/fluid$(EXEEXT)
  370. # All OpenGL demos depend on the FLTK and FLTK_GL libraries...
  371. $(GLALL): $(LIBNAME) $(GLLIBNAME)
  372. # OpenGL demos...
  373. CubeView$(EXEEXT): CubeMain.o CubeView.o CubeViewUI.o
  374. echo Linking $@...
  375. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ \
  376. CubeMain.o CubeView.o CubeViewUI.o \
  377. $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
  378. CubeMain.o: CubeViewUI.h CubeView.h CubeViewUI.cxx
  379. CubeView.o: CubeView.h
  380. CubeViewUI.o: CubeViewUI.cxx CubeViewUI.h
  381. CubeViewUI.cxx: CubeViewUI.fl ../fluid/fluid$(EXEEXT)
  382. cube$(EXEEXT): cube.o
  383. echo Linking $@...
  384. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ cube.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
  385. fractals$(EXEEXT): fractals.o fracviewer.o
  386. echo Linking $@...
  387. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ fractals.o fracviewer.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
  388. fullscreen$(EXEEXT): fullscreen.o
  389. echo Linking $@...
  390. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ fullscreen.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
  391. glpuzzle$(EXEEXT): glpuzzle.o
  392. echo Linking $@...
  393. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ glpuzzle.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
  394. gl_overlay$(EXEEXT): gl_overlay.o
  395. echo Linking $@...
  396. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ gl_overlay.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
  397. shape$(EXEEXT): shape.o
  398. echo Linking $@...
  399. $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ shape.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
  400. cairo_test$(EXEEXT): cairo_test.o
  401. echo Linking $@...
  402. $(CXX) $(ARCHFLAGS) $(CAIROFLAGS) $(LDFLAGS) -o $@ cairo_test.o $(LINKFLTK) $(LINKFLTKCAIRO) $(GLDLIBS)
  403. #
  404. # End of "$Id: Makefile 8389 2011-02-06 14:08:08Z manolo $".
  405. #