about summary refs log tree commit diff
path: root/converter/other/jbig/Makefile
blob: b5f4e14a1eb9efc0fcaa137b90b490bd976e59b0 (plain) (blame)
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
45
46
47
ifeq ($(SRCDIR)x,x)
  SRCDIR = $(CURDIR)/../../..
  BUILDDIR = $(SRCDIR)
endif
SUBDIR = converter/other/jbig
VPATH=.:$(SRCDIR)/$(SUBDIR)

include $(BUILDDIR)/config.mk

LIBJBIG_OBJECTS = jbig.o jbig_tab.o

EXTERN_INCLUDES =
ifneq ($(JBIGHDR_DIR),NONE)
  EXTERN_INCLUDES += -I$(JBIGHDR_DIR)
endif

ifneq ($(JBIGHDR_DIR),NONE)
  ifneq ($(JBIGLIB),NONE)
    BINARIES = jbigtopnm pnmtojbig
  endif
endif

SCRIPTS =

ifeq ($(JBIGLIB),$(BUILDDIR)/$(SUBDIR)/libjbig.a)
  JBIGLIB_DEP = $(JBIGLIB)
else
  # It's not our internal version; user's on his own to make sure it's built
endif

OBJECTS = $(BINARIES:%=%.o) $(LIBJBIG_OBJECTS)
MERGE_OBJECTS = $(BINARIES:%=%.o2) $(LIBJBIG_OBJECTS)

all: $(BINARIES)

include $(SRCDIR)/common.mk

$(BINARIES): %: %.o $(JBIGLIB_DEP) $(NETPBMLIB) $(LIBOPT)
	$(LD) -o $@ $< \
	  $(shell $(LIBOPT) $(NETPBMLIB) $(JBIGLIB)) $(MATHLIB) \
	  $(LDFLAGS) $(LDLIBS) $(RPATH) $(LADD)


$(BUILDDIR)/$(SUBDIR)/libjbig.a: $(LIBJBIG_OBJECTS)
	$(AR) -rc $@ $^
	$(RANLIB) $@