view modules/sample/external/Makefile.in.in @ 5512:4aa8ee813265

Add a DESTDIR variable to all Makefiles, defaulting to the empty string, and use it in install targets. See xemacs-patches message <BANLkTinRnwk9qsCfBj_xkcyf7H4sH9fn7A@mail.gmail.com>.
author Jerry James <james@xemacs.org>
date Wed, 25 May 2011 09:15:20 -0600
parents dd9541c73e70
children
line wrap: on
line source

##   Makefile for the sample module in XEmacs.
##   Copyright (C) 2002 Jerry James.
##
##   This sample Makefile is free; you can redistribute it and/or modify it
##   under the terms of the GNU General Public License as published by the
##   Free Software Foundation, either version 3 of the License, or (at your
##   option) any later version.

## This file is not part of XEmacs.

### Specialize this part for your module
MODNAME=sample
MODVER=0.0.1
MODTITLE="Sample module for XEmacs"
SRCS=sample.c

### You should not need to modify anything below this line
DESTDIR=
SHELL=/bin/sh
RM=rm -f
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@

srcdir=@srcdir@
VPATH=@srcdir@

SRC_SRCS=$(SRCS:%=$(srcdir)/%)
OBJS=$(SRCS:.c=.o)

ELLCC=@ELLCC@
MODARCHDIR=$(shell @ELLCC@ --mod-archdir)
INSTALLPATH=$(shell @ELLCC@ --mod-site-location)
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@

.PHONY:	clean distclean install
all: $(MODNAME).ell

.c.o:
	$(ELLCC) $(CFLAGS) --mode=compile --mod-output=$@ \
	-I$(MODARCHDIR)/include -c $<

$(MODNAME).ell: $(OBJS) $(MODNAME)_i.o
	$(ELLCC) --mode=link --mod-output=$@ $(OBJS) $(MODNAME)_i.o $(LDFLAGS)

$(MODNAME)_i.c: $(SRCS)
	ELLMAKEDOC=$(MODARCHDIR)/make-docfile $(ELLCC) --mode=init \
	--mod-output=$@ --mod-name=$(MODNAME) --mod-version=$(MODVER) \
	--mod-title=$(MODTITLE) $(SRC_SRCS)

clean:
	$(RM) $(MODNAME).ell $(OBJS) $(MODNAME)_i.* *~

distclean: clean
	$(RM) Makefile config.* configure

install: $(MODNAME).ell
	$(INSTALL_PROGRAM) $< $(DESTDIR)$(INSTALLPATH)