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