add infrastructure for kpathsea
[mplib] / src / texk / make / common.mk
1 # common.mk -- used by all Makefiles.
2 SHELL = /bin/sh
3 @SET_MAKE@
4 top_srcdir = @top_srcdir@
5 srcdir = @srcdir@
6 VPATH = @srcdir@
7
8 CC = @CC@
9 CFLAGS = @CFLAGS@ $(XCFLAGS)
10 CPPFLAGS = @CPPFLAGS@ $(XCPPFLAGS)
11 DEFS = @DEFS@ $(XDEFS)
12 LDFLAGS = @LDFLAGS@ $(XLDFLAGS)
13
14 # Kpathsea needs this for compiling, programs need it for linking.
15 LIBTOOL = $(SHELL) $(kpathsea_parent)/libtool
16
17 # You can change [X]CPPFLAGS, [X]CFLAGS, or [X]DEFS, but
18 # please don't change ALL_CPPFLAGS or ALL_CFLAGS.
19 # prog_cflags is set by subdirectories of web2c.
20 ALL_CPPFLAGS = $(DEFS) -I. -I$(srcdir) -I$(kpathsea_parent) \
21   -I$(kpathsea_srcdir_parent) $(prog_cflags) $(CPPFLAGS)
22 ALL_CFLAGS = $(ALL_CPPFLAGS) $(CFLAGS)
23 ALL_CXXFLAGS = $(ALL_CPPFLAGS) $(CXXFLAGS)
24 compile = $(CC) $(ALL_CFLAGS)
25
26 .SUFFIXES:
27 .SUFFIXES: .c .o .lo # in case the suffix list has been cleared, e.g., by web2c
28 .c.o:
29         $(compile) -c $< -o $@
30
31 # Installation.
32 INSTALL = @INSTALL@
33 INSTALL_PROGRAM = @INSTALL_PROGRAM@
34 INSTALL_SCRIPT = @INSTALL_SCRIPT@
35 INSTALL_DATA = @INSTALL_DATA@
36 INSTALL_LIBTOOL_LIBS = $(LIBTOOL) --mode=install $(INSTALL_DATA)
37 INSTALL_LIBTOOL_PROG = $(LIBTOOL) --mode=install $(INSTALL_PROGRAM)
38
39 # Creating (symbolic) links.
40 LN = @LN_S@
41
42 # Removing files.
43 RM = rm -f
44
45 # Uninstall.
46 UNINSTALL = $(RM)
47 UNINSTALL_PROGRAM = $(RM)
48 UNINSTALL_SCRIPT = $(RM)
49 UNINSTALL_DATA = $(RM)
50 UNINSTALL_LIBTOOL_LIBS = $(LIBTOOL) --mode=uninstall $(RM)
51 UNINSTALL_LIBTOOL_PROG = $(LIBTOOL) --mode=uninstall $(RM)
52
53 # We use these for many things.
54 kpathsea_parent = ..
55 kpathsea_dir = $(kpathsea_parent)/kpathsea
56 kpathsea_srcdir_parent = $(top_srcdir)/..
57 kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea
58 kpathsea = $(kpathsea_dir)/libkpathsea.la
59
60 @MAINT@ifeq ($(CC), gcc)
61 @MAINT@XDEFS = -Wpointer-arith $(warn_more)
62 @MAINT@CFLAGS = -g $(XCFLAGS)
63 @MAINT@endif
64 # End of common.mk.