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.

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