3 mandir = $(prefix)/share/man
5 includedir = $(prefix)/include
6 pkgconfigdir = $(libdir)/pkgconfig
8 PROGS = ptb2ly ptb2ascii $(shell pkg-config --exists libxml-2.0 && echo ptb2xml ptb2musicxml)
9 LIBS = libptb-$(PTB_VERSION).so
10 PROGS_MANPAGES = $(patsubst %,%.1,$(PROGS))
12 CFLAGS = -g -Wall -DPTB_VERSION=\"$(PTB_VERSION)\"
14 PTB2LY_OBJS = ptb2ly.o ptb.o
15 PTB2ASCII_OBJS = ptb2ascii.o ptb.o
16 PTB2MUSICXML_OBJS = ptb2musicxml.o ptb.o
17 PTB2XML_OBJS = ptb2xml.o ptb.o
23 $(CC) $(CFLAGS) -c $< `pkg-config --cflags glib-2.0 libxml-2.0`
25 ptb2musicxml.o: ptb2musicxml.c
26 $(CC) $(CFLAGS) -c $< `pkg-config --cflags glib-2.0 libxml-2.0`
29 $(CC) $(CFLAGS) -c $< `pkg-config --cflags glib-2.0`
31 libptb-$(PTB_VERSION).so: $(PTBSO_OBJS)
32 $(CC) -shared $(CFLAGS) -o $@ $(PTBSO_OBJS) `pkg-config --libs glib-2.0`
34 ptb2xml: $(PTB2XML_OBJS)
35 $(CC) $(CFLAGS) -o $@ $(PTB2XML_OBJS) `pkg-config --libs glib-2.0 libxml-2.0` -lpopt
37 ptb2musicxml: $(PTB2MUSICXML_OBJS)
38 $(CC) $(CFLAGS) -o $@ $(PTB2MUSICXML_OBJS) `pkg-config --libs glib-2.0 libxml-2.0` -lpopt
40 ptb2ascii: $(PTB2ASCII_OBJS)
41 $(CC) $(CFLAGS) -o $@ $(PTB2ASCII_OBJS) `pkg-config --libs glib-2.0` -lpopt
43 ptb2ly: $(PTB2LY_OBJS)
44 $(CC) $(CFLAGS) -o $@ $(PTB2LY_OBJS) `pkg-config --libs glib-2.0` -lpopt
47 $(INSTALL) $(PROGS) $(DESTDIR)$(bindir)
48 $(INSTALL) -m 644 $(PROGS_MANPAGES) $(DESTDIR)$(mandir)/man1
49 $(INSTALL) $(LIBS) $(DESTDIR)$(libdir)
50 $(INSTALL) -m 644 ptb.h $(DESTDIR)$(includedir)
51 $(INSTALL) -m 644 ptabtools.pc $(DESTDIR)$(pkgconfigdir)
57 rm -f *.o core $(PROGS) $(LIBS)