ref: 941b73315a166fe07e0f1a1b81171477285280f7
parent: f6066822041bbffd7169fd4bfc19c48daae8f155
author: Tor Andersson <tor.andersson@gmail.com>
date: Wed Jul 14 20:41:46 EDT 2010
Add Makefile.unix -- a simple makefile for unix-like systems.
--- /dev/null
+++ b/Makefile.unix
@@ -1,0 +1,45 @@
+# Simple unix makefile
+
+default: all
+
+prefix ?= /usr/local
+
+CFLAGS := -Wall -g -O2 -DHAVE_STDINT_H
+
+LIB_SRCS := \
+ jbig2_arith.c jbig2_arith_int.c jbig2_arith_iaid.c \
+ jbig2_huffman.c jbig2_segment.c jbig2_page.c jbig2_symbol_dict.c \
+ jbig2_text.c jbig2_halftone.c jbig2_generic.c jbig2_refinement.c \
+ jbig2_mmr.c jbig2_image.c jbig2_metadata.c jbig2.c
+LIB_OBJS := $(LIB_SRCS:%.c=%.o)
+LIB_HDRS := \
+ jbig2.h jbig2_arith.h jbig2_arith_iaid.h jbig2_arith_int.h \
+ jbig2_generic.h jbig2_huffman.h jbig2_hufftab.h jbig2_image.h \
+ jbig2_metadata.h jbig2_mmr.h jbig2_priv.h jbig2_symbol_dict.h \
+ jbig2_text.h os_types.h
+
+APP_SRCS := jbig2_image_pbm.c jbig2_image_png.c jbig2dec.c sha1.c
+APP_OBJS := $(APP_SRCS:%.c=%.o)
+APP_HDRS := sha1.h
+
+$(LIB_OBJS): $(LIB_HDRS)
+$(APP_OBJS): $(LIB_HDRS) $(APP_HDRS)
+
+libjbig2dec.a: $(LIB_OBJS)
+ ar cru $@ $^
+
+jbig2dec: $(APP_OBJS) libjbig2dec.a
+ $(CC) -o $@ $^ -lpng -lz
+
+all: jbig2dec libjbig2dec.a
+
+install: jbig2dec libjbig2dec.a
+ install -d $(prefix)/bin $(prefix)/lib $(prefix)/include $(prefix)/man/man1
+ install jbig2dec $(prefix)/bin
+ install jbig2dec.1 $(prefix)/man/man1
+ install jbig2.h $(prefix)/include
+ install libjbig2dec.a $(prefix)/lib
+
+clean:
+ rm -f *.o jbig2dec libjbig2dec.a
+