about summary refs log tree commit diff
path: root/converter/other/jbig/Makefile
blob: 1b9d7535241b4f83f584a7244db887433a6e2a30 (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)/Makefile.config

LIBJBIG_OBJECTS = jbig.o jbig_tab.o

INCLUDES =
ifneq ($(JBIGHDR_DIR),NONE)
  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)/Makefile.common

$(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) $@