2000-07-30 19:03:52 +02:00
|
|
|
name=zsh/main
|
2000-11-26 21:01:01 +01:00
|
|
|
link=static
|
|
|
|
load=yes
|
|
|
|
# load=static should replace use of alwayslink
|
2016-02-14 15:37:53 +01:00
|
|
|
functions='Functions/Chpwd/* Functions/Exceptions/* Functions/Math/* Functions/Misc/* Functions/MIME/* Functions/Prompts/* Functions/VCS_Info/* Functions/VCS_Info/Backends/*'
|
2000-07-30 19:03:52 +02:00
|
|
|
|
1999-04-15 20:05:38 +02:00
|
|
|
nozshdep=1
|
|
|
|
alwayslink=1
|
|
|
|
|
2015-09-27 21:43:25 +02:00
|
|
|
# autofeatures not specified because of alwayslink
|
1999-04-15 20:05:38 +02:00
|
|
|
|
2015-01-08 22:39:26 +01:00
|
|
|
objects="builtin.o compat.o cond.o context.o \
|
|
|
|
exec.o glob.o hashtable.o hashnameddir.o \
|
1999-04-15 20:05:38 +02:00
|
|
|
hist.o init.o input.o jobs.o lex.o linklist.o loop.o math.o \
|
2000-07-30 19:03:52 +02:00
|
|
|
mem.o module.o options.o params.o parse.o pattern.o prompt.o signals.o \
|
2007-01-21 23:47:36 +01:00
|
|
|
signames.o sort.o string.o subst.o text.o utils.o watch.o"
|
1999-04-15 20:05:38 +02:00
|
|
|
|
2011-05-10 18:44:38 +02:00
|
|
|
headers="../config.h zsh_system.h zsh.h sigcount.h signals.h \
|
1999-04-15 20:05:38 +02:00
|
|
|
prototypes.h hashtable.h ztype.h"
|
2011-05-11 10:59:55 +02:00
|
|
|
hdrdeps="zshcurses.h zshterm.h"
|
1999-04-15 20:05:38 +02:00
|
|
|
|
|
|
|
:<<\Make
|
2000-07-30 19:03:52 +02:00
|
|
|
@CONFIG_MK@
|
|
|
|
|
2015-01-15 14:50:09 +01:00
|
|
|
# If we're using gcc as the preprocessor, get rid of the additional
|
|
|
|
# lines generated by the preprocessor as they can confuse the script.
|
|
|
|
# We don't need these in other cases either, but can't necessarily rely
|
|
|
|
# on the option to remove them being the same.
|
2000-07-30 19:03:52 +02:00
|
|
|
signames.c: signames1.awk signames2.awk ../config.h @SIGNAL_H@
|
|
|
|
$(AWK) -f $(sdir)/signames1.awk @SIGNAL_H@ >sigtmp.c
|
2015-04-28 10:20:15 +02:00
|
|
|
case "`$(CPP) --version </dev/null 2>&1`" in \
|
|
|
|
*"Free Software Foundation"*) \
|
2015-01-15 14:50:09 +01:00
|
|
|
$(CPP) -P sigtmp.c >sigtmp.out;; \
|
|
|
|
*) \
|
|
|
|
$(CPP) sigtmp.c >sigtmp.out;; \
|
|
|
|
esac
|
2000-07-30 19:03:52 +02:00
|
|
|
$(AWK) -f $(sdir)/signames2.awk sigtmp.out > $@
|
|
|
|
rm -f sigtmp.c sigtmp.out
|
1999-04-15 20:05:38 +02:00
|
|
|
|
|
|
|
sigcount.h: signames.c
|
|
|
|
grep 'define.*SIGCOUNT' signames.c > $@
|
|
|
|
|
|
|
|
init.o: bltinmods.list zshpaths.h zshxmods.h
|
|
|
|
|
2007-04-23 18:44:24 +02:00
|
|
|
init.o params.o parse.o: version.h
|
1999-04-15 20:05:38 +02:00
|
|
|
|
2009-01-09 21:28:30 +01:00
|
|
|
params.o: patchlevel.h
|
|
|
|
|
2008-03-13 12:10:59 +01:00
|
|
|
version.h: $(sdir_top)/Config/version.mk zshcurses.h zshterm.h
|
1999-04-15 20:05:38 +02:00
|
|
|
echo '#define ZSH_VERSION "'$(VERSION)'"' > $@
|
|
|
|
|
2013-02-18 16:35:07 +01:00
|
|
|
patchlevel.h: FORCE
|
2013-04-09 21:21:57 +02:00
|
|
|
@if [ -f $(sdir)/$@.release ]; then \
|
|
|
|
cp -f $(sdir)/$@.release $@; \
|
|
|
|
else \
|
2013-06-13 18:46:43 +02:00
|
|
|
echo '#define ZSH_PATCHLEVEL "'`cd $(sdir) && git describe --tags --long`'"' > $@.tmp; \
|
2014-01-27 16:42:48 +01:00
|
|
|
cmp $@ $@.tmp >/dev/null 2>&1 && rm -f $@.tmp || mv $@.tmp $@; \
|
2013-04-09 21:21:57 +02:00
|
|
|
fi
|
2013-02-18 16:35:07 +01:00
|
|
|
FORCE:
|
2009-01-09 21:28:30 +01:00
|
|
|
|
2008-03-13 12:10:59 +01:00
|
|
|
zshcurses.h: ../config.h
|
|
|
|
@if test x$(ZSH_CURSES_H) != x; then \
|
|
|
|
echo "#include <$(ZSH_CURSES_H)>" >zshcurses.h; \
|
|
|
|
else \
|
|
|
|
echo >zshcurses.h; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
zshterm.h: ../config.h
|
|
|
|
@if test x$(ZSH_TERM_H) != x; then \
|
|
|
|
echo "#include <$(ZSH_TERM_H)>" >zshterm.h; \
|
|
|
|
else \
|
|
|
|
echo >zshterm.h; \
|
|
|
|
fi
|
|
|
|
|
2000-07-30 19:03:52 +02:00
|
|
|
zshpaths.h: Makemod $(CONFIG_INCS)
|
1999-04-15 20:05:38 +02:00
|
|
|
@echo '#define MODULE_DIR "'$(MODDIR)'"' > zshpaths.h.tmp
|
2005-07-20 18:08:12 +02:00
|
|
|
@if test x$(sitescriptdir) != xno; then \
|
|
|
|
echo '#define SITESCRIPT_DIR "'$(sitescriptdir)'"' >> zshpaths.h.tmp; \
|
|
|
|
fi
|
|
|
|
@if test x$(scriptdir) != xno; then \
|
|
|
|
echo '#define SCRIPT_DIR "'$(scriptdir)'"' >> zshpaths.h.tmp; \
|
|
|
|
fi
|
2000-07-30 19:03:52 +02:00
|
|
|
@if test x$(sitefndir) != xno; then \
|
|
|
|
echo '#define SITEFPATH_DIR "'$(sitefndir)'"' >> zshpaths.h.tmp; \
|
|
|
|
fi
|
2014-09-20 21:14:09 +02:00
|
|
|
@if test x$(fixed_sitefndir) != x; then \
|
|
|
|
echo '#define FIXED_FPATH_DIR "'$(fixed_sitefndir)'"' >> zshpaths.h.tmp; \
|
|
|
|
fi
|
2000-07-30 19:03:52 +02:00
|
|
|
@if test x$(fndir) != xno; then \
|
|
|
|
echo '#define FPATH_DIR "'$(fndir)'"' >> zshpaths.h.tmp; \
|
2005-07-26 17:01:40 +02:00
|
|
|
if test x$(FUNCTIONS_SUBDIRS) != x && \
|
|
|
|
test x$(FUNCTIONS_SUBDIRS) != xno; then \
|
2000-12-04 20:21:05 +01:00
|
|
|
fpath_tmp="`grep ' functions=.' \
|
|
|
|
$(dir_top)/config.modules | sed -e '/^#/d' -e '/ link=no/d' \
|
|
|
|
-e 's/^.* functions=//'`"; \
|
|
|
|
fpath_tmp=`for f in $$fpath_tmp; do \
|
2001-04-02 16:36:36 +02:00
|
|
|
echo $$f | sed -e 's%^Functions/%%' -e 's%/[^/]*$$%%' -e 's%/\*%%'; \
|
2005-07-26 17:01:40 +02:00
|
|
|
done | grep -v Scripts | sort | uniq`; \
|
2000-12-04 20:21:05 +01:00
|
|
|
fpath_tmp=`echo $$fpath_tmp | sed 's/ /\", \"/g'`; \
|
2000-07-30 19:03:52 +02:00
|
|
|
echo "#define FPATH_SUBDIRS { \"$$fpath_tmp\" }" \
|
|
|
|
>>zshpaths.h.tmp; \
|
|
|
|
fi; \
|
|
|
|
fi
|
2011-04-18 22:36:31 +02:00
|
|
|
@if test x$(additionalfpath) != x; then \
|
|
|
|
fpath_tmp="`echo $(additionalfpath) | sed -e 's:,:\", \":g'`"; \
|
|
|
|
echo "#define ADDITIONAL_FPATH { \"$$fpath_tmp\" }" >> zshpaths.h.tmp; \
|
|
|
|
fi
|
1999-04-15 20:05:38 +02:00
|
|
|
@if cmp -s zshpaths.h zshpaths.h.tmp; then \
|
|
|
|
rm -f zshpaths.h.tmp; \
|
|
|
|
echo "\`zshpaths.h' is up to date." ; \
|
|
|
|
else \
|
|
|
|
mv -f zshpaths.h.tmp zshpaths.h; \
|
|
|
|
echo "Updated \`zshpaths.h'." ; \
|
|
|
|
fi
|
|
|
|
|
2000-11-26 21:01:01 +01:00
|
|
|
bltinmods.list: modules.stamp mkbltnmlst.sh $(dir_top)/config.modules
|
|
|
|
srcdir='$(sdir)' CFMOD='$(dir_top)/config.modules' \
|
|
|
|
$(SHELL) $(sdir)/mkbltnmlst.sh $@
|
1999-04-15 20:05:38 +02:00
|
|
|
|
2000-11-26 21:01:01 +01:00
|
|
|
zshxmods.h: $(dir_top)/config.modules
|
1999-04-15 20:05:38 +02:00
|
|
|
@echo "Creating \`$@'."
|
|
|
|
@( \
|
2000-11-26 21:01:01 +01:00
|
|
|
for q_mod in `grep ' load=yes' $(dir_top)/config.modules | \
|
|
|
|
grep ' link=static' | sed -e '/^#/d' -e 's/ .*//' \
|
|
|
|
-e 's/^name=//' -e 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`; do \
|
|
|
|
test x$q_mod = xzshQsmain && continue; \
|
|
|
|
echo "#define LINKED_XMOD_$$q_mod 1"; \
|
|
|
|
done; \
|
|
|
|
for q_mod in `grep ' load=yes' $(dir_top)/config.modules | \
|
|
|
|
grep ' link=dynamic' | sed -e '/^#/d' -e 's/ .*//' \
|
|
|
|
-e 's/^name=//' -e 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`; do \
|
|
|
|
test x$q_mod = x && continue; \
|
|
|
|
echo "#ifdef DYNAMIC"; \
|
|
|
|
echo "# define UNLINKED_XMOD_$$q_mod 1"; \
|
|
|
|
echo "#endif"; \
|
|
|
|
done; \
|
1999-04-15 20:05:38 +02:00
|
|
|
) > $@
|
|
|
|
|
|
|
|
clean-here: clean.zsh
|
|
|
|
clean.zsh:
|
|
|
|
rm -f sigcount.h signames.c bltinmods.list version.h zshpaths.h zshxmods.h
|
|
|
|
|
|
|
|
# This is not properly part of this module, but it is built as if it were.
|
2000-07-30 19:03:52 +02:00
|
|
|
main.o: main.c zsh.mdh main.epro
|
2011-05-10 18:40:27 +02:00
|
|
|
$(CC) -c -I. -I$(sdir_top)/Src $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(sdir)/main.c
|
1999-04-15 20:05:38 +02:00
|
|
|
|
2000-07-30 19:03:52 +02:00
|
|
|
main.syms: $(PROTODEPS)
|
|
|
|
proto.zsh: main.epro
|
1999-04-15 20:05:38 +02:00
|
|
|
Make
|