summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2008-08-04 14:28:14 -0400
committerNathan Straz <nstraz@redhat.com>2008-08-04 14:28:14 -0400
commite01f689aa62ec343670bfdea5235c919666d4aba (patch)
treebb253e3c4e3f360c27cd863a1ec70288e0d935b2 /Makefile
downloadgxpp-e01f689aa62ec343670bfdea5235c919666d4aba.tar.gz
gxpp-e01f689aa62ec343670bfdea5235c919666d4aba.tar.xz
gxpp-e01f689aa62ec343670bfdea5235c919666d4aba.zip
Initial check-in of gxpp, a grep-like tool for XML and XPath.
This includes the main program, man page, Makefile, and RPM spec.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1aa1d9f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+
+TARGETS := gxpp
+
+all: $(TARGETS)
+
+CFLAGS := -Wall -g
+gxpp: gxp-int.c
+gxpp: CFLAGS += -I/usr/include/libxml2
+gxpp: LOADLIBES := -lxml2
+
+install: all
+ for i in $(TARGETS); do \
+ install -D $$i $(DESTDIR)/usr/bin/$$i; \
+ install -D $$i.1 $(DESTDIR)/usr/share/man/man1/$$i.1; \
+ done
+
+clean:
+ $(RM) $(TARGETS)
+
+
+VERSION := $(shell awk '/^Version:/ { print $$2 }' gxpp.spec)
+
+ifdef DIST
+ RPMDEFS := -D "dist $(DIST)"
+endif
+
+tarfiles := gxpp.spec Makefile
+tarfiles += $(patsubst %,%.c,$(TARGETS))
+tarfiles += gxp-int.c gxp-int.h
+tarfiles += $(patsubst %,%.1,$(TARGETS))
+
+tarball := gxpp-$(VERSION).tar.bz2
+
+$(tarball): $(tarfiles)
+ -$(RM) $@
+ tar cjf $@ $^
+
+tarball: $(tarball)
+
+rpm: $(tarball) $(tarfiles)
+ rpmbuild -ta $< $(RPMDEFS)
+
+srpm: $(tarball) $(tarfiles)
+ rpmbuild -ts $< $(RPMDEFS)