about summary refs log tree commit diff
path: root/converter/other/jbig/Makefile
blob: 0625edd3b41e13c2971e0b9e540a0e456cc933ce (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
48
49
50
51
52
53
54
55
ifeq ($(SRCDIR)x,x)
  SRCDIR = $(CURDIR)/../../..
  BUILDDIR = $(SRCDIR)
endif
SUBDIR = converter/other/jbig
VPATH=.:$(SRCDIR)/$(SUBDIR)

SUBDIRS = libjbig

include $(BUILDDIR)/config.mk

# INTERNAL_JBIGLIB must be relative to the current directory, because it
# may end up in MERGE_OBJECTS, which must be relative.
INTERNAL_JBIGLIB = libjbig/libjbig.a
INTERNAL_JBIGHDR_DIR = $(SRCDIR)/$(SUBDIR)/libjbig/include

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

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

BINARIES = $(PORTBINARIES)

SCRIPTS =

ifeq ($(JBIGLIB),$(INTERNAL_JBIGLIB))
  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)
MERGE_OBJECTS = $(BINARIES:%=%.o2)

all: $(BINARIES)

include $(SRCDIR)/common.mk

$(BINARIES): %: %.o $(JBIGLIB_DEP) $(LIBOPT)
$(BINARIES): LDFLAGS_TARGET = $(shell $(LIBOPT) $(JBIGLIB))

$(INTERNAL_JBIGLIB): $(BUILDDIR)/$(SUBDIR)/libjbig FORCE
	$(MAKE) -f $(SRCDIR)/$(SUBDIR)/libjbig/Makefile \
	  -C $(dir $@) $(notdir $@)

.PHONY: FORCE
FORCE: