diff buildsys.mk.in @ 2856:59ff744e1e23

merge
author Paula Stanciu <paula.stanciu@gmail.com>
date Fri, 01 Aug 2008 22:55:49 +0300
parents f2bec2d589d6
children 74c302381136
line wrap: on
line diff
--- 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 <js-buildsys@webkeks.org>
+#  Copyright (c) 2007 - 2008, Jonathan Schleifer <js-buildsys@webkeks.org>
 #
 #  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}; \