about summary refs log tree commit diff
path: root/other/pamx/Makefile
blob: 7fe7b9dbcd16984765fd92d55b25af202327019d (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
56
57
58
59
60
61
ifeq ($(SRCDIR)x,x)
  SRCDIR = $(CURDIR)/../..
  BUILDDIR = $(SRCDIR)
endif
SUBDIR = other/pamx
VPATH=.:$(SRCDIR)/$(SUBDIR)

include $(BUILDDIR)/config.mk

EXTERN_INCLUDE =

TEST_PKGCONFIG_X11 := \
  if $(PKG_CONFIG) x11 --exists; then echo exists; fi

ifeq ($(shell $(TEST_PKGCONFIG_X11)),)
  # Pkg-config has never heard of X11, or doesn't even exist

  ifneq ($(X11LIB),NONE)
    HAVE_X11LIB = Y
    ifneq ($(X11HDR_DIR)x,x)
      EXTERN_INCLUDES += -I$(X11HDR_DIR)
    endif
  endif
else
  HAVE_X11LIB = Y
  X11LIB = $(shell $(PKG_CONFIG) x11 --libs)
  EXTERN_INCLUDES += $(shell $(PKG_CONFIG) x11 --cflags)
endif

ifeq ($(HAVE_X11LIB),Y)
  PORTBINARIES += pamx

  EXTRA_OBJECTS = \
	  image.o \
	  send.o \
	  window.o \

endif

BINARIES = $(PORTBINARIES)

OBJECTS = $(BINARIES:%=%.o) $(EXTRA_OBJECTS)

MERGE_OBJECTS = $(BINARIES:%=%.o2) $(EXTRA_OBJECTS)

MERGEBINARIES = $(BINARIES)

all: $(BINARIES)

include $(SRCDIR)/common.mk

ifeq ($(shell $(TEST_PKGCONFIG_X11)),)
  # Pkg-config has never heard of X11, or doesn't even exist
  X11_LIBOPTS = $(shell $(LIBOPT) $(LIBOPTR) $(X11LIB))
else
  X11_LIBOPTS = $(shell $(PKG_CONFIG) x11 --libs)
endif

pamx: image.o send.o window.o
pamx: ADDL_OBJECTS = image.o send.o window.o
pamx: LDFLAGS_TARGET = $(X11_LIBOPTS)