summary refs log tree commit diff
path: root/Src/zsh.mdd
blob: 244029d65bdde3744fa05dc126fccd6dda8c60c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
nozshdep=1
alwayslink=1

# autobins not specified because of alwayslink

objects="builtin.o compat.o cond.o exec.o glob.o hashtable.o \
hist.o init.o input.o jobs.o lex.o linklist.o loop.o math.o \
mem.o module.o options.o params.o parse.o prompt.o signals.o \
signames.o subst.o text.o utils.o watch.o"

headers="../config.h system.h zsh.h sigcount.h signals.h \
prototypes.h hashtable.h ztype.h"

:<<\Make
signames.c: signames.awk @SIGNAL_H@
	$(AWK) -f $(sdir)/signames.awk @SIGNAL_H@ > $@

sigcount.h: signames.c
	grep 'define.*SIGCOUNT' signames.c > $@

init.o: bltinmods.list zshpaths.h zshxmods.h

params.o: version.h

version.h: $(sdir_top)/Config/version.mk
	echo '#define ZSH_VERSION "'$(VERSION)'"' > $@

zshpaths.h: FORCE
	@echo '#define MODULE_DIR "'$(MODDIR)'"' > zshpaths.h.tmp
	@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

bltinmods.list: modules.stamp modules-bltin xmods.conf mkbltnmlst.sh
	srcdir='$(sdir)' MODBINS='modules-bltin' \
	XMODCF='$(sdir)/xmods.conf' $(SHELL) $(sdir)/mkbltnmlst.sh $@

zshxmods.h: modules-bltin xmods.conf
	@echo "Creating \`$@'."
	@( \
	    binmods=`sed 's/^/ /;s/$$/ /' modules-bltin`; \
	    for mod in `cat $(sdir_src)/xmods.conf`; do \
		case $$binmods in \
		    *" $$mod "*) \
			echo "#define    LINKED_XMOD_$$mod 1" ;; \
		    *)  echo "#ifdef DYNAMIC"; \
			echo "# define UNLINKED_XMOD_$$mod 1"; \
			echo "#endif" ;; \
		esac; \
	    done; \
	    echo; \
	    for mod in $$binmods; do \
		echo "int boot_$$mod _((Module));"; \
	    done; \
	) > $@

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.
main.o: main.c zsh.mdh main.pro
	$(CC) -c -I. $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(sdir)/main.c

main.pro: $(PROTODEPS)
proto.zsh: main.pro
Make