add man pages, distribute utility programs in new d2x-common deb
[btb/d2x.git] / Makefile.am
1 DIST_SUBDIRS = 2d 3d maths mem cfile console iff texmap misc arch main libmve utilities
2
3 SUBDIRS = ${DIST_SUBDIRS} @D2X_SUBDIRS@
4
5 EXTRA_SUBDIRS = include unused debian rpm
6
7 if BUILD_MACOSX_BUNDLE
8 bundle_contents = @PACKAGE@.app/Contents
9 else
10 if BUILD_SIMPLE_BUNDLE
11 bundle_contents = @PACKAGE@
12 endif
13 endif
14
15 bin_PROGRAMS = @TARGETS@
16
17 EXTRA_PROGRAMS = d2x d2x-sdl d2x-gl d2x-svga d2x-ggi
18
19 ARCH_LIBS = $(foreach subdir,${D2X_ARCH_SUBDIRS},arch/${subdir}/libarch_${subdir}.a)
20
21 if MINGW32
22 LD_KLUDGE = main/inferno.o
23 endif
24
25 if MACOSX
26 AM_LDFLAGS = -all_load
27 endif
28
29 if EDITOR
30 EDITOR_LIBS = main/editor/libeditor.a
31 endif
32
33 if CONSOLE
34 CONSOLE_LIBS = console/libconsole.a
35 endif
36
37 d2x_SOURCES =
38 d2x_sdl_SOURCES =
39 d2x_gl_SOURCES =
40 d2x_svga_SOURCES =
41 d2x_ggi_SOURCES =
42
43 d2x_LDADD = ${LD_KLUDGE} main/libmain.a ${EDITOR_LIBS} 3d/lib3d.a 2d/lib2d.a ${ARCH_LIBS} libmve/libmve.a mem/libmem.a cfile/libcfile.a iff/libiff.a texmap/libtexmap.a misc/libmisc.a maths/libmaths.a ${CONSOLE_LIBS}
44
45 if MINGW32
46 if USE_NETWORK
47 d2x_sdl_LDADD = ${d2x_LDADD} -lwsock32
48 else
49 d2x_sdl_LDADD = ${d2x_LDADD}
50 endif
51 else
52 d2x_sdl_LDADD = ${d2x_LDADD} -lm
53 endif
54 d2x_gl_LDADD = ${d2x_sdl_LDADD} ${OGL_LIBS}
55 d2x_svga_LDADD = ${d2x_sdl_LDADD} ${SVGA_LIBS}
56 d2x_ggi_LDADD = ${d2x_sdl_LDADD} ${GGI_LIBS}
57
58 dist-hook:
59         rm -rf `find $(distdir) -name CVS`
60 #       rm -f `find $(distdir) -name Makefile`
61
62 pkgdatadir = @sharepath@
63 missiondir = ${pkgdatadir}/missions
64
65 CLEANFILES = @TARGETS@ Info.plist
66
67 if BUILD_MACOSX_BUNDLE
68
69 @PACKAGE@_bundle: @TARGETS@
70         mkdir -p $(bundle_contents)/MacOS
71         echo "APPL????" > $(bundle_contents)/PkgInfo
72         $(INSTALL_DATA) Info.plist $(bundle_contents)
73         $(INSTALL_PROGRAM) @TARGETS@ $(bundle_contents)/MacOS/
74
75 install-exec-hook: @PACKAGE@_bundle
76         rm -rf $(DESTDIR)$(prefix)/@PACKAGE@.app
77         mkdir -p $(DESTDIR)$(prefix)/
78         cp -r @PACKAGE@.app $(DESTDIR)$(prefix)/
79
80 clean-local:
81         rm -rf $(bundle_contents)
82
83 else
84
85 if BUILD_SIMPLE_BUNDLE
86
87 @PACKAGE@_bundle: @TARGETS@
88         $(INSTALL_PROGRAM) @TARGETS@ $(bundle_contents)/
89
90 install-exec-hook: @PACKAGE@_bundle
91         rm -rf $(DESTDIR)/$(prefix)/@PACKAGE@
92         mkdir -p $(DESTDIR)/$(prefix)/
93         cp COPYING @PACKAGE@/COPYING.txt
94         cp COPYING.LIB @PACKAGE@/COPYING_LIB.txt
95         cp ChangeLog @PACKAGE@/ChangeLog.txt
96         cp TODO @PACKAGE@/TODO.txt
97         cp README @PACKAGE@/README.txt
98         cp README.jp @PACKAGE@/README_jp.txt
99         cp README.sfont @PACKAGE@/sfont.txt
100         cp README.xkobo @PACKAGE@/xkobo.txt
101         cp README.xkobo.jp @PACKAGE@/xkobo_jp.txt
102         cp 501 @PACKAGE@/scores/42
103         cp -r @PACKAGE@  $(DESTDIR)/$(prefix)/
104
105 clean-local:
106         rm -rf $(bundle_contents)
107
108 else
109 @PACKAGE@_bundle:
110
111 install-exec-hook:
112
113 clean-local:
114
115 endif
116
117 endif
118
119 EXTRA_DIST = ${EXTRA_SUBDIRS} \
120 ChangeLog \
121 README.utils \
122 djgpp.bat djgpp.sh \
123 autogen.sh cygconf \
124 cvshowto.txt readme.txt installation.txt compilerdefs.txt \
125 d2x-sdl.sh d2x-gl.sh