diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2011-02-17 14:27:30 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-02-17 14:27:30 +0100 |
commit | 0c08f2609d818276427d1b99777aadeb406175b0 (patch) | |
tree | c83fa3bccc8575759c8327255a37b921a03aace0 /GNUmakefile | |
download | libpcd-eb5aeb44c36842a2fae1f85df1275525730c4cbe.tar.gz |
import 1.0.1 release tarball1.0.1
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..e007f0a --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,64 @@ + +DESTDIR := +prefix := /usr/local + +incdir := $(DESTDIR)$(prefix)/include +libdir := $(DESTDIR)$(prefix)/lib + +CC := gcc +WARN := -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith +CFLAGS ?= -g -O2 +CFLAGS += $(WARN) + +MAJOR := 2 +MINOR := 2.0.1 +SONAME := libpcd.so.$(MAJOR) +TARGETS := libpcd.a libpcd.so.$(MINOR) + +SRCS := file.c yuv2rgb.c huff.c inter.c +STATIC := $(subst .c,.o,$(SRCS)) +SHARED := $(subst .c,.pic.o,$(SRCS)) +depfile = $(subst .o,.dep,$@) + +all build: $(TARGETS) + +%.o: %.c + $(CC) $(CFLAGS) -Wp,-MD,$(depfile) -c -o $@ $< + +%.pic.o: %.c + $(CC) $(CFLAGS) -Wp,-MD,$(depfile) -fPIC -c -o $@ $< + +libpcd.a: $(STATIC) + rm -f $@ + ar rc $@ $(STATIC) + ranlib $@ + +libpcd.so.$(MINOR): $(SHARED) + rm -f $@ + $(CC) $(CFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $(SHARED) + +install: + install -d $(libdir) + install -d $(incdir) + install -m644 libpcd.a $(libdir) + install -m755 libpcd.so.$(MINOR) $(libdir) + ln -s libpcd.so.$(MINOR) $(libdir)/libpcd.so.$(MAJOR) + ln -s libpcd.so.$(MINOR) $(libdir)/libpcd.so + install -m644 pcd.h $(incdir) + +clean: + -rm -f *~ *.bak *.dep $(STATIC) $(SHARED) + +realclean distclean: clean + -rm -f libpcd.a libpcd.so.$(MAJOR) libpcd.so.$(MINOR) + +# auto dependencies +-include *.dep + +# debian stuff +dsc source: distclean + dpkg-buildpackage -S -us -uc -rfakeroot + +debs pbuild: dsc + sudo /usr/sbin/pbuilder build ../libpcd_*.dsc + |