view src/Makefile.pmake @ 1299:6949e2b6cae2

Add unlink clone checker. - Monitor changes of DOM-tree of the document - Unlinking a clone is actually removing the clone and copying nodes from the source. - Copy value of ID of a node to saved_id to track source of copy nodes. - For a new node with 'saved_id' is a copy of another node. - Copy vulae of 'saved_id' to 'ns0:duplicate-src' to keep the source - Change value of 'saved_id' to the value of ID of the node for later copying. - For a new node without 'saved_id' is not a copy of another node. - only set 'saved_id' to the value of its ID.
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 16 Jan 2011 16:13:37 +0800
parents 586e50f82c1f
children
line wrap: on
line source

# -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*-
# vim: sw=4:ts=8:sts=4
SRCS =	coord.c geo.c shape_path.c shape_text.c shape_rect.c \
     	shape_image.c \
	redraw_man.c timer.c animate.c paint.c event.c observer.c \
	X_supp.c timertool.c tools.c shift.c chgcolor.c \
	visibility.c rotate.c prop.c mouse.c img_ldr.c
OBJS = ${SRCS:C/(.*)\.c/\1.o/g}
TESTCASE_SRCS = ${SRCS:C/X_supp\.c//}
TESTCASE_OBJS = ${TESTCASE_SRCS:C/(.*)\.c/testcase-\1.o/g}
CFLAGS+=	-Wall -I../include -I/usr/local/include \
		`pkg-config --cflags cairo`
LDFLAGS =	`pkg-config --libs cairo`
BINS =	libmbfly.a X_main
PREFIX?=/usr/local/
HEADERS=	X_supp.h animate.h mb.h mb_timer.h mb_types.h \
		observer.h paint.h redraw_man.h shapes.h tools.h
MKDIR?=	mkdir -p

all: $(BINS)

install: $(BINS)
	$(INSTALL) -d ${PREFIX}include/mb
.for i in $(HEADERS)
	$(INSTALL) -o root -m 0644 ${i} ${PREFIX}include/mb/
.endfor
	$(INSTALL) -o root libmbfly.a ${PREFIX}lib/

uninstall:
.for i in $(HEADERS)
	rm -f ${PREFIX}include/mb/${i}
.endfor
	rm -f ${PREFIX}lib/libmbfly.a
	rmdir ${PREFIX}include/mb/

testcase: testcase.o $(TESTCASE_OBJS)
	$(CC) $(LDFLAGS) -o $@ $(.ALLSRC) -L/usr/local/lib -lcunit

libmbfly.a: $(OBJS)
	$(AR) -cr $@ $(.ALLSRC)


.for i in $(TESTCASE_OBJS)
${i}: ${i:C/testcase-(.*).o/\1.c/}
	$(CC) $(CFLAGS) -DUNITTEST -g -c -o $@ $(.ALLSRC)
.endfor

testcase.o:	testcase.c
	$(CC) $(CFLAGS) -c $(.ALLSRC)

X_main: X_main.o libmbfly.a
	$(CC) $(CFALGS) `pkg-config --libs cairo` -o $@ $(.ALLSRC)

X_main.o: X_main.c
	$(CC) $(CFLAGS) `pkg-config --cflags cairo` -c $(.ALLSRC)

clean:
	for i in *.o *~ *.core $(SHAPE_OBJS) $(BINS) testcase; do \
		echo "delete $$i"; \
		rm -f $$i; \
	done

depend:
	mkdep $(CFLAGS) $(SRCS)