Check for failed allocations. Spotted by Martin Bealby.
[reactos.git] / rosapps / mc / make.common.in
1 VERSION=4.1.36
2
3 SHELL = /bin/sh
4
5 # This variable makes it possible to move the installation root to another
6 # directory. This is useful when you're creating a binary distribution of mc.
7 # If empty, normal root will be used.
8 # You can run e.g. 'make install DESTDIR=/packages/mc/3.0' to accomplish
9 # that.
10 # DESTDIR = /opt/apps/mc/$(VERSION)
11
12 # Installation target directories & other installation stuff
13 prefix = @prefix@
14 exec_prefix = $(prefix)
15 binprefix =
16 manprefix =
17
18 builddir = @builddir@
19 bindir = $(exec_prefix)/bin
20 libdir = $(exec_prefix)/lib/mc
21 suppbindir = $(libdir)/bin
22 tidir = $(libdir)/term
23 extfsdir = $(libdir)/extfs
24 icondir = $(prefix)/share/icons/mc
25 mandir = $(prefix)/man/man1
26 datadir = $(prefix)/share
27 localedir = $(datadir)/locale
28 manext = 1
29 man8dir = $(prefix)/man/man8
30 man8ext = 8
31 xv_bindir = @xv_bindir@
32
33 # Tools & program stuff
34 SEDCMD = @SEDCMD@
35 SEDCMD2 = @SEDCMD2@
36 STRIP = @STRIP@
37 @SET_MAKE@
38 CC = @CC@
39 CPP = @CPP@
40 AR = @AR@
41 RANLIB = @RANLIB@
42 RM = @RM@
43 RMF = @RM@ -f
44 MV = @MV@
45 CP = @CP@
46 LN_S = @LN_S@
47 AWK = @AWK@
48 AWK_VAR_OPTION = @AWK_VAR_OPTION@
49
50 # Flags & libs
51 # No way, to make make happy (except GNU), we cannot use := to append
52 # something to these, so that's why there is a leading _
53 XCFLAGS = @CFLAGS@
54 XCPPFLAGS = @CPPFLAGS@ -I.. -DBINDIR=\""$(bindir)/"\" -DLIBDIR=\""$(libdir)/"\" -DICONDIR=\""$(icondir)/"\" $(XINC) -DLOCALEDIR=\""$(localedir)/"\"
55 XLDFLAGS = @LDFLAGS@
56 XDEFS = @DEFS@
57 XLIBS = @LIBS@
58
59 # Where do we have the sources?
60 # You shouldn't have to edit this :)
61 mcsrcdir = $(rootdir)/src
62 docdir = $(rootdir)/doc
63 mclibdir = $(rootdir)/lib
64 slangdir = $(rootdir)/slang
65 vfsdir = $(rootdir)/vfs
66 xvdir = $(rootdir)/xv
67 tkdir = $(rootdir)/tk
68 gnomedir = $(rootdir)/gnome
69 icodir = $(rootdir)/icons
70
71 hpath = -I$(mcsrcdir) -I$(slangdir) -I$(vfsdir) -I$(xvdir) -I$(xvdir)/support/xview_private -I$(tkdir)
72
73 # Rules
74 first_rule: all
75
76 @PHONY@ all check cross TAGS clean install uninstall distcopy depend dep
77 @PHONY@ fastdep fastdepslang fastdepvfs fastdeploc slowdep
78
79 @PCENTRULE@../slang/%.o : ../slang/%.c
80 @PCENTRULE@ cd ../slang; $(MAKE) libmcslang.a
81
82 @PCENTRULE@../vfs/%.o : ../vfs/%.c
83 @PCENTRULE@ cd ../vfs; $(MAKE) libvfs.a
84
85 fastdep: dummy
86 if test x"`echo $(srcdir)/*.[ch]`" != x'$(srcdir)/*.[ch]'; then { cd $(srcdir); $(AWK) -f $(mcsrcdir)/depend.awk $(AWK_VAR_OPTION) hpath="$(hpath)" $(AWK_VAR_OPTION) srcdir="$(srcdir)" *.[ch];} > .depend; fi
87 -$(MAKE) fastdeploc
88 @WRITEDEP@
89
90 fastdepslang:
91 @PCENTRULE@ { { { cd ../slang; $(MAKE) showlibdep;} | grep OBJS; cat .depend;} | { cd $(slangdir); $(AWK) -f $(mcsrcdir)/depend.awk $(AWK_VAR_OPTION) dolib="../slang libmcslang.a" $(AWK_VAR_OPTION) hpath="$(hpath)" $(AWK_VAR_OPTION) srcdir="$(slangdir)";};} >> .depend
92
93 fastdepvfs:
94 @PCENTRULE@ { { { cd ../vfs; $(MAKE) showlibdep;} | grep OBJS; cat .depend;} | { cd $(vfsdir); $(AWK) -f $(mcsrcdir)/depend.awk $(AWK_VAR_OPTION) dolib="../vfs libvfs.a" $(AWK_VAR_OPTION) hpath="$(hpath)" $(AWK_VAR_OPTION) srcdir="$(vfsdir)";};} >> .depend
95
96 slowdep: dummy
97 if test x"`echo $(srcdir)/*.[ch]`" != x'$(srcdir)/*.[ch]'; then \
98 $(CPP) -M $(CPPFLAGS) $(DEFS) $(CFLAGS) $(srcdir)/*.c > .depend; fi
99 @WRITEDEP@
100
101 mcdep: @dep@
102
103 dummy:
104
105 # End of Make.common