# Copyright © 2005 Atheme Development Group. # Rights to this code are documented in doc/LICENSE. # # This file contains common rules. # # $Id: Makefile.common.in,v 1.1 2007/07/19 08:24:51 pippijn Exp $ # default: all SRCS = ${BASE_SRCS} OBJS = ${SRCS:.C=.so} all: build .build.stamp: @${MAKE} ${SILENT} build @touch .build.stamp install: .build.stamp extra-install @${INSTALL} -d $(DESTDIR)${MODDIR}/modules/$(MODULE) @${INSTALL} -m 755 *.so $(DESTDIR)${MODDIR}/modules/$(MODULE) build: $(OBJS) @touch .build.stamp .SUFFIXES: .o .so .xs .C.o: @echo " CC $@" @${CXX} -c ${PICFLAGS} ${CPPFLAGS} ${CXXFLAGS} $< -o $@ .C.so: @echo " LD $@" @${CXX} ${PICFLAGS} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} $< -o $@ .PHONY: depend clean distclean # This sed command sucks but I don't know a better way -- jilles depend: @${MKDEP} ${PICFLAGS} ${CPPFLAGS} ${CXXFLAGS} ${SRCS} ${EXTRA_SRCS} | sed -e 's|\([^.]*\)\.o:|$(SRCDIR)/\1.so:|' > .depend clean: extra-clean @${RM} -f $(OBJS) @${RM} -f .build.stamp distclean: clean @${RM} -f Makefile .depend maintainer-clean: distclean @${RM} -f $(MAINTAINERCLEANFILES) extra-clean: extra-install: include .depend