summaryrefslogtreecommitdiff
blob: cd386b5df20a1fe28ce0f5c685091009969dc634 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Simple unix makefile

default: all

prefix ?= /usr/local

CFLAGS := -Wall -Wextra -Wno-unused-parameter -g -O2

LIB_SRCS := \
	jbig2_arith.c jbig2_arith_int.c jbig2_arith_iaid.c \
	jbig2_huffman.c jbig2_hufftab.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.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_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