XEmacs 21.2.20 "Yoko".
[chise/xemacs-chise.git.1] / modules / sample / Makefile
1 #
2 # Sample makefile for a simple Emacs module.
3 # This is slightly more complicated than would normally be the case,
4 # as this makefile has been tailored to work in the Emacs source tree.
5 # For samples of how to compile modules outside of the source tree
6 # (as would be the case if a user had downloaded a module and wanted
7 # to compile it for use within Emacs), see the samples in the sub-directory
8 # 'installed'.
9 #
10
11 CC=../../lib-src/ellcc
12 CFLAGS=-I. -I../../src
13 LD=$(CC) --mode=link
14 MKINIT=$(CC) --mode=init
15
16 SRCS=sample.c
17 OBJS=$(SRCS:.c=.o)
18
19 .c.o:
20         $(CC) $(CFLAGS) -c $<
21
22 MODNAME=sample
23 MODVER=1.0.0
24 MODTITLE="Sample loadable module"
25
26 all: $(MODNAME).ell
27
28 distclean: clean
29
30 clean:
31         rm -f $(MODNAME).ell $(OBJS) sample_i.o sample_i.c
32
33 $(MODNAME).ell: $(OBJS) sample_i.o
34         $(LD) --mod-output=$@ $(OBJS) sample_i.o
35
36 sample_i.o: sample_i.c
37 sample_i.c: $(SRCS)
38         ELLMAKEDOC=../../lib-src/make-docfile $(MKINIT) --mod-output=$@ \
39         --mod-name=$(MODNAME) --mod-version=$(MODVER) \
40         --mod-title=$(MODTITLE) $(SRCS)
41