]> icculus.org git repositories - btb/d2x.git/blob - Makefile.am
7d0e9914e8751ae5363e1d83be3de1e67a289cd3
[btb/d2x.git] / Makefile.am
1 SUBDIRS = 2d 3d maths mem cfile iff texmap misc arch main
2
3 EXTRA_SUBDIRS = include tools unused debian rpm
4
5 bin_PROGRAMS = @TARGETS@
6
7 EXTRA_PROGRAMS = d2x d2x-sdl d2x-gl d2x-svga d2x-ggi
8
9 CCLD = ${CC}
10 LDFLAGS = -export-dynamic
11 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
12
13 ARCH_LIBS = $(foreach subdir,${D2X_ARCH_SUBDIRS},arch/${subdir}/libarch_${subdir}.a)
14
15 if MINGW32
16 LD_KLUDGE = main/inferno.o
17 endif
18
19 if EDITOR
20 EDITOR_LIBS = main/editor/libeditor.a
21 endif
22
23 d2x_SOURCES =
24 d2x_sdl_SOURCES =
25 d2x_gl_SOURCES =
26 d2x_svga_SOURCES =
27 d2x_ggi_SOURCES =
28
29 d2x_LDADD = ${LD_KLUDGE} main/libmain.a ${EDITOR_LIBS} 3d/lib3d.a 2d/lib2d.a ${ARCH_LIBS} mem/libmem.a cfile/libcfile.a iff/libiff.a texmap/libtexmap.a misc/libmisc.a maths/libmaths.a
30
31 if MINGW32
32 if USE_NETWORK
33 d2x_sdl_LDADD = ${d2x_LDADD} -lwsock32
34 else
35 d2x_sdl_LDADD = ${d2x_LDADD}
36 endif
37 else
38 d2x_sdl_LDADD = ${d2x_LDADD} -lm -ldl -lpthread
39 endif
40 d2x_gl_LDADD = ${d2x_sdl_LDADD} ${OGL_LIBS}
41 d2x_svga_LDADD = ${d2x_sdl_LDADD} ${SVGA_LIBS}
42 d2x_ggi_LDADD = ${d2x_sdl_LDADD} ${GGI_LIBS}
43
44 dist-hook:
45         rm -rf `find $(distdir) -name CVS`
46 #       rm -f `find $(distdir) -name Makefile`
47         $(MAKE) changelog
48         cp -a $(srcdir)/ChangeLog $(distdir)
49
50 changelog::
51         rm -f $(srcdir)/ChangeLog
52         touch $(srcdir)/ChangeLog
53         cd $(srcdir) && tools/cvs2cl/cvs2cl.pl -b --utc
54         rm -f $(srcdir)/ChangeLog.bak
55
56 EXTRA_DIST = ${EXTRA_SUBDIRS} \
57 ChangeLog \
58 djgpp.bat djgpp.sh \
59 autogen.sh cygconf \
60 cvshowto.txt readme.txt installation.txt mingw32.txt compilerdefs.txt \
61 d2x-sdl.sh d2x-gl.sh