# HG changeset patch # User Paula Stanciu # Date 1217620549 -10800 # Node ID 59ff744e1e2395b7cc350d6d97feb72b566732a1 # Parent 162766a69f128908ec49fd8b8cb4abe0dcd67119# Parent f2bec2d589d6bc29d64e39fa621055480e5be9d5 merge diff -r 162766a69f12 -r 59ff744e1e23 buildsys.mk.in --- a/buildsys.mk.in Fri Aug 01 22:53:40 2008 +0300 +++ b/buildsys.mk.in Fri Aug 01 22:55:49 2008 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Jonathan Schleifer +# Copyright (c) 2007 - 2008, Jonathan Schleifer # # https://webkeks.org/hg/buildsys/ # @@ -46,7 +46,7 @@ LIB_LDFLAGS = @LIB_LDFLAGS@ LIB_PREFIX = @LIB_PREFIX@ LIB_SUFFIX = @LIB_SUFFIX@ -PLUGIN_DEFNAME = `echo -n ${subst ${PLUGIN_SUFFIX},,${PLUGIN}} | tr [:lower:] [:upper:] | tr -C [:alnum:] _` +PLUGIN_DEFNAME = `echo ${subst ${PLUGIN_SUFFIX},,${PLUGIN}} | tr [:lower:] [:upper:]` PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ -D${PLUGIN_DEFNAME}_CFGID=\"${subst ${PLUGIN_SUFFIX},,${PLUGIN}}\" PLUGIN_CFLAGS = @PLUGIN_CFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ @@ -75,11 +75,11 @@ OBJS3 = ${OBJS2:.cxx=.o} OBJS4 = ${OBJS3:.d=.o} OBJS5 = ${OBJS4:.erl=.beam} -OBJS += ${OBJS5:.m=.o} -DEPS += ${OBJS:.o=.dep} +OBJS6 = ${OBJS5:.m=.o} +OBJS += ${OBJS6:.xpm=.o} .SILENT: -.SUFFIXES: .beam .c .cc .cxx .d .dep .erl .m +.SUFFIXES: .beam .c .cc .cxx .d .dep .erl .m .xpm .PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean all: @@ -96,17 +96,25 @@ depend: pre-depend ${SRCS} regen=0; \ + deps=""; \ test -f .deps || regen=1; \ - for i in ${SRCS}; do test $$i -nt .deps && regen=1; done; \ - if test x"$$regen" = x"1" -a x"${DEPS}" != "x"; then \ + for i in ${SRCS}; do \ + case $$i in \ + *.o) \ + test $$i -nt .deps && regen=1; \ + deps="$${deps%.o}.dep $$i"; \ + ;; \ + esac; \ + done; \ + if test x"$$regen" = x"1" -a x"$$deps" != "x"; then \ ${DEPEND_STATUS}; \ rm -f .deps; \ - if ${MAKE} ${MFLAGS} ${DEPS}; then \ - cat ${DEPS} >.deps; \ - rm -f ${DEPS}; \ + if ${MAKE} ${MFLAGS} $$deps; then \ + cat $$deps >.deps; \ + rm -f $$deps; \ ${DEPEND_OK}; \ else \ - rm -f .deps ${DEPS}; \ + rm -f .deps $$deps; \ ${DEPEND_FAILED}; \ fi; \ fi @@ -115,6 +123,7 @@ ${CPP} ${CPPFLAGS} -M $< >$@ .d.dep: +.xpm.dep: pre-depend: @@ -198,6 +207,14 @@ ${COMPILE_FAILED}; \ fi +.xpm.o: + ${COMPILE_STATUS} + if ${CC} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + ${COMPILE_OK}; \ + else \ + ${COMPILE_FAILED}; \ + fi + install: ${LIB} ${STATIC_LIB} ${PLUGIN} ${PROG} install-extra for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \