]> icculus.org git repositories - btb/d2x.git/blob - Makefile.am
change ENV_DJGPP to DJGPP
[btb/d2x.git] / Makefile.am
1 SUBDIRS = 2d 3d maths mem cfile iff texmap misc arch main
2
3 EXTRA_SUBDIRS = includes tools unused
4
5 bin_PROGRAMS = @TARGETS@
6
7 EXTRA_PROGRAMS = d2x d2x-sdl d2x-ogl d2x-svga d2x-ggi
8
9 CCLD = ${CC}
10 LDFLAGS = -export-dynamic
11 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
12
13 if DJGPP
14 ARCH_LIBS = arch/dos/libarch_dos.a
15 else
16 if USE_OPENGL
17 if MINGW32
18 ARCH_LIBS = arch/win32/libarch_win32.a arch/sdl/libarch_sdl.a arch/ogl/libarch_ogl.a
19 LD_KLUDGE = main/inferno.o
20 else
21 ARCH_LIBS = arch/linux/libarch_linux.a arch/sdl/libarch_sdl.a arch/ogl/libarch_ogl.a
22 endif
23 else
24 if MINGW32
25 ARCH_LIBS = arch/win32/libarch_win32.a arch/sdl/libarch_sdl.a
26 LD_KLUDGE = main/inferno.o
27 else
28 ARCH_LIBS = arch/linux/libarch_linux.a arch/sdl/libarch_sdl.a
29 endif
30 endif
31 endif
32
33 if EDITOR
34 EDITOR_LIBS = main/editor/libeditor.a
35 endif
36
37 d2x_SOURCES =
38 d2x_sdl_SOURCES =
39 d2x_ogl_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} mem/libmem.a cfile/libcfile.a iff/libiff.a texmap/libtexmap.a misc/libmisc.a maths/libmaths.a
44
45 if MINGW32
46 if USE_NETWORK
47 d2x_sdl_LDADD = ${d2x_LDADD} ${SDL_LIBS} -lwsock32
48 else
49 d2x_sdl_LDADD = ${d2x_LDADD} ${SDL_LIBS}
50 endif
51 else
52 d2x_sdl_LDADD = ${d2x_LDADD} -lm -ldl -lpthread ${SDL_LIBS}
53 endif
54 d2x_ogl_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         $(MAKE) changelog
62         cp -a $(srcdir)/ChangeLog $(distdir)
63
64 changelog::
65         rm -f $(srcdir)/ChangeLog
66         touch $(srcdir)/ChangeLog
67         cd $(srcdir) && tools/cvs2cl/cvs2cl.pl -b --utc
68         rm -f $(srcdir)/ChangeLog.bak
69
70 EXTRA_DIST = ${EXTRA_SUBDIRS} \
71 ChangeLog \
72 djgpp.bat djgpp.sh \
73 autogen.sh cygconf \
74 cvshowto.txt readme.txt license.txt thinking.txt installation.txt mingw32.txt compilerdefs.txt