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