| 1 |
pippijn |
1.1 |
# Copyright © 2005 Atheme Development Group. |
| 2 |
pippijn |
1.2 |
# Rights to this code are documented in doc/pod/license.pod. |
| 3 |
pippijn |
1.1 |
# |
| 4 |
|
|
# This file contains common rules. |
| 5 |
|
|
# |
| 6 |
pippijn |
1.2 |
# $Id: Makefile.common.in,v 1.1 2007-07-19 08:24:51 pippijn Exp $ |
| 7 |
pippijn |
1.1 |
# |
| 8 |
|
|
|
| 9 |
|
|
default: all |
| 10 |
|
|
|
| 11 |
|
|
SRCS = ${BASE_SRCS} |
| 12 |
|
|
|
| 13 |
|
|
OBJS = ${SRCS:.C=.so} |
| 14 |
|
|
|
| 15 |
|
|
all: build |
| 16 |
|
|
|
| 17 |
|
|
.build.stamp: |
| 18 |
|
|
@${MAKE} ${SILENT} build |
| 19 |
|
|
@touch .build.stamp |
| 20 |
|
|
|
| 21 |
|
|
install: .build.stamp extra-install |
| 22 |
|
|
@${INSTALL} -d $(DESTDIR)${MODDIR}/modules/$(MODULE) |
| 23 |
|
|
@${INSTALL} -m 755 *.so $(DESTDIR)${MODDIR}/modules/$(MODULE) |
| 24 |
|
|
|
| 25 |
|
|
build: $(OBJS) |
| 26 |
|
|
@touch .build.stamp |
| 27 |
|
|
|
| 28 |
|
|
.SUFFIXES: .o .so .xs |
| 29 |
|
|
|
| 30 |
|
|
.C.o: |
| 31 |
|
|
@echo " CC $@" |
| 32 |
|
|
@${CXX} -c ${PICFLAGS} ${CPPFLAGS} ${CXXFLAGS} $< -o $@ |
| 33 |
|
|
|
| 34 |
|
|
.C.so: |
| 35 |
|
|
@echo " LD $@" |
| 36 |
|
|
@${CXX} ${PICFLAGS} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} $< -o $@ |
| 37 |
|
|
|
| 38 |
|
|
.PHONY: depend clean distclean |
| 39 |
|
|
|
| 40 |
|
|
# This sed command sucks but I don't know a better way -- jilles |
| 41 |
|
|
depend: |
| 42 |
|
|
@${MKDEP} ${PICFLAGS} ${CPPFLAGS} ${CXXFLAGS} ${SRCS} ${EXTRA_SRCS} | sed -e 's|\([^.]*\)\.o:|$(SRCDIR)/\1.so:|' > .depend |
| 43 |
|
|
|
| 44 |
|
|
clean: extra-clean |
| 45 |
|
|
@${RM} -f $(OBJS) |
| 46 |
|
|
@${RM} -f .build.stamp |
| 47 |
|
|
|
| 48 |
|
|
distclean: clean |
| 49 |
|
|
@${RM} -f Makefile .depend |
| 50 |
|
|
|
| 51 |
|
|
maintainer-clean: distclean |
| 52 |
|
|
@${RM} -f $(MAINTAINERCLEANFILES) |
| 53 |
|
|
|
| 54 |
|
|
extra-clean: |
| 55 |
|
|
|
| 56 |
|
|
extra-install: |
| 57 |
|
|
|
| 58 |
|
|
include .depend |