1### @configure_input@
2
3# Copyright 2017-2021 Free Software Foundation, Inc.
4
5# This file is part of GNU Emacs.
6
7# GNU Emacs is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11
12# GNU Emacs is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16
17# You should have received a copy of the GNU General Public License
18# along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
19
20srcdir = @srcdir@
21VPATH = @srcdir@
22
23# Variables substituted by 'configure', and not autogenerated in gnulib.mk,
24# or needed before gnulib.mk is included.
25abs_top_srcdir = @abs_top_srcdir@
26top_builddir = @top_builddir@
27top_srcdir = @top_srcdir@
28
29all:
30.PHONY: all
31
32# 'make' verbosity.
33AM_V_AR = $(am__v_AR_@AM_V@)
34am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
35am__v_AR_0 = @echo "  AR      " $@;
36am__v_AR_1 =
37
38AM_V_CC = $(am__v_CC_@AM_V@)
39am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
40am__v_CC_0 = @echo "  CC      " $@;
41am__v_CC_1 =
42
43AM_V_GEN = $(am__v_GEN_@AM_V@)
44am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
45am__v_GEN_0 = @echo "  GEN     " $@;
46am__v_GEN_1 =
47
48AM_V_at = $(am__v_at_@AM_V@)
49am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
50am__v_at_0 = @
51am__v_at_1 =
52
53ALL_CFLAGS= \
54  $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) $(DEPFLAGS) \
55  $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \
56  -I. -I../src -I$(srcdir) -I$(srcdir)/../src \
57  $(if $(patsubst e-%,,$(notdir $<)),,-Demacs)
58
59SYSTEM_TYPE = @SYSTEM_TYPE@
60ifeq ($(SYSTEM_TYPE),windows-nt)
61  include $(srcdir)/../nt/gnulib-cfg.mk
62endif
63include gnulib.mk
64ifneq ($(SYSTEM_TYPE),windows-nt)
65  libgnu_a_SOURCES += openat-die.c save-cwd.c
66endif
67
68DEPDIR = deps
69ifeq ($(AUTO_DEPEND),yes)
70  DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP
71  -include $(ALLOBJS:%.o=$(DEPDIR)/%.d)
72else
73  DEPFLAGS =
74endif
75
76.PRECIOUS: ../config.status Makefile
77../config.status: $(top_srcdir)/configure.ac $(top_srcdir)/m4/*.m4
78	$(MAKE) -C .. $(notdir $@)
79Makefile: ../config.status $(srcdir)/Makefile.in
80	$(MAKE) -C .. src/$@
81
82# Object modules that need not be built for Emacs.
83# Emacs does not need e-regex.o (it has its own regex-emacs.c),
84# and building it would just waste time.
85not_emacs_OBJECTS = regex.o
86
87libgnu_a_OBJECTS = fingerprint.o $(gl_LIBOBJS) \
88  $(patsubst %.c,%.o,$(filter %.c,$(libgnu_a_SOURCES)))
89for_emacs_OBJECTS = $(filter-out $(not_emacs_OBJECTS),$(libgnu_a_OBJECTS))
90libegnu_a_OBJECTS = $(patsubst %.o,e-%.o,$(for_emacs_OBJECTS))
91
92$(libegnu_a_OBJECTS) $(libgnu_a_OBJECTS): $(BUILT_SOURCES)
93
94.c.o:
95	$(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
96e-%.o: %.c
97	$(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -Demacs -o $@ $<
98
99all: libgnu.a $(if $(HYBRID_MALLOC),libegnu.a)
100
101libgnu.a: $(libgnu_a_OBJECTS)
102	$(AM_V_at)rm -f $@
103	$(AM_V_AR)$(AR) $(ARFLAGS) $@ $(libgnu_a_OBJECTS)
104	$(AM_V_at)$(RANLIB) $@
105
106libegnu.a: $(libegnu_a_OBJECTS)
107	$(AM_V_at)rm -f $@
108	$(AM_V_AR)$(AR) $(ARFLAGS) $@ $(libegnu_a_OBJECTS)
109	$(AM_V_at)$(RANLIB) $@
110
111ETAGS = ../lib-src/etags$(EXEEXT)
112$(ETAGS):
113	$(MAKE) -C $(dir $@) $(notdir $@)
114tagsfiles= $(wildcard $(srcdir)/*.[ch])
115tags: TAGS
116TAGS: $(ETAGS) $(tagsfiles)
117	$(ETAGS) $(tagsfiles)
118.PHONY: $(ETAGS) tags
119
120clean:
121	rm -f ./*.[ao] ./*-t \#* $(DEPDIR)/*
122mostlyclean: clean
123	rm -f $(filter-out %-t,$(MOSTLYCLEANFILES))
124distclean bootstrap-clean: mostlyclean
125	rm -f Makefile
126	rm -fr $(DEPDIR)
127maintainer-clean: distclean
128	rm -f TAGS gnulib.mk
129extraclean: distclean
130	-rmdir sys 2>/dev/null
131
132.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
133
134# Tell versions [3.59,3.63) of GNU make to not export all variables.
135# Otherwise a system limit (for SysV at least) may be exceeded.
136.NOEXPORT:
137