| 1 |
# |
| 2 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 3 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 |
|
| 6 |
|
| 7 |
#! gmake |
| 8 |
|
| 9 |
MOD_DEPTH = ../../.. |
| 10 |
topsrcdir = @top_srcdir@ |
| 11 |
srcdir = @srcdir@ |
| 12 |
VPATH = @srcdir@ |
| 13 |
|
| 14 |
include $(MOD_DEPTH)/config/autoconf.mk |
| 15 |
|
| 16 |
include $(topsrcdir)/config/config.mk |
| 17 |
|
| 18 |
INCLUDES = -I$(dist_includedir) |
| 19 |
|
| 20 |
CSRCS =\ |
| 21 |
plvrsion.c \ |
| 22 |
strlen.c \ |
| 23 |
strcpy.c \ |
| 24 |
strdup.c \ |
| 25 |
strcase.c \ |
| 26 |
strcat.c \ |
| 27 |
strcmp.c \ |
| 28 |
strchr.c \ |
| 29 |
strpbrk.c \ |
| 30 |
strstr.c \ |
| 31 |
strtok.c \ |
| 32 |
base64.c \ |
| 33 |
plerror.c \ |
| 34 |
plgetopt.c \ |
| 35 |
$(NULL) |
| 36 |
|
| 37 |
LIBRARY_NAME = plc |
| 38 |
LIBRARY_VERSION = $(MOD_MAJOR_VERSION) |
| 39 |
|
| 40 |
RELEASE_LIBS = $(TARGETS) |
| 41 |
|
| 42 |
ifeq ($(OS_ARCH),WINNT) |
| 43 |
RES=$(OBJDIR)/plc.res |
| 44 |
RESNAME=plc.rc |
| 45 |
endif # WINNT |
| 46 |
|
| 47 |
ifeq ($(OS_ARCH), AIX) |
| 48 |
ifeq ($(CLASSIC_NSPR),1) |
| 49 |
OS_LIBS = -lc |
| 50 |
else |
| 51 |
OS_LIBS = -lc_r |
| 52 |
endif |
| 53 |
endif |
| 54 |
|
| 55 |
ifeq ($(OS_ARCH),SunOS) |
| 56 |
OS_LIBS = -lc |
| 57 |
MAPFILE = $(OBJDIR)/plcmap.sun |
| 58 |
GARBAGE += $(MAPFILE) |
| 59 |
ifdef NS_USE_GCC |
| 60 |
ifdef GCC_USE_GNU_LD |
| 61 |
MKSHLIB += -Wl,--version-script,$(MAPFILE) |
| 62 |
else |
| 63 |
MKSHLIB += -Wl,-M,$(MAPFILE) |
| 64 |
endif |
| 65 |
else |
| 66 |
MKSHLIB += -M $(MAPFILE) |
| 67 |
endif |
| 68 |
# The -R '$ORIGIN' linker option instructs this library to search for its |
| 69 |
# dependencies in the same directory where it resides. |
| 70 |
MKSHLIB += -R '$$ORIGIN' |
| 71 |
endif |
| 72 |
|
| 73 |
EXTRA_LIBS = $(LIBNSPR) |
| 74 |
|
| 75 |
# On SCOOS, we can't link with extra libraries when |
| 76 |
# we build a shared library. If we do so, the linker doesn't |
| 77 |
# complain, but we would run into weird problems at run-time. |
| 78 |
# Therefore on these platforms, we link just the .o files. |
| 79 |
ifeq ($(OS_ARCH),SCOOS) |
| 80 |
EXTRA_LIBS = |
| 81 |
endif |
| 82 |
|
| 83 |
ifdef RESOLVE_LINK_SYMBOLS |
| 84 |
EXTRA_LIBS += $(OS_LIBS) |
| 85 |
endif |
| 86 |
|
| 87 |
include $(topsrcdir)/config/rules.mk |
| 88 |
|
| 89 |
# |
| 90 |
# Version information generation (begin) |
| 91 |
# |
| 92 |
ECHO = echo |
| 93 |
TINC = $(OBJDIR)/_pl_bld.h |
| 94 |
PROD = $(notdir $(SHARED_LIBRARY)) |
| 95 |
NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now |
| 96 |
SH_DATE = $(shell date "+%Y-%m-%d %T") |
| 97 |
SH_NOW = $(shell $(NOW)) |
| 98 |
|
| 99 |
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) |
| 100 |
SUF = i64 |
| 101 |
else |
| 102 |
SUF = LL |
| 103 |
endif |
| 104 |
|
| 105 |
GARBAGE += $(TINC) |
| 106 |
|
| 107 |
$(TINC): |
| 108 |
@$(MAKE_OBJDIR) |
| 109 |
@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC) |
| 110 |
@if test ! -z "$(SH_NOW)"; then \ |
| 111 |
$(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \ |
| 112 |
else \ |
| 113 |
true; \ |
| 114 |
fi |
| 115 |
@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC) |
| 116 |
|
| 117 |
|
| 118 |
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC) |
| 119 |
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) |
| 120 |
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $< |
| 121 |
else |
| 122 |
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $< |
| 123 |
endif |
| 124 |
# |
| 125 |
# Version information generation (end) |
| 126 |
# |
| 127 |
|
| 128 |
# |
| 129 |
# The Client build wants the shared libraries in $(dist_bindir), |
| 130 |
# so we also install them there. |
| 131 |
# |
| 132 |
|
| 133 |
export:: $(TARGETS) |
| 134 |
$(INSTALL) -m 444 $(TARGETS) $(dist_libdir) |
| 135 |
ifdef SHARED_LIBRARY |
| 136 |
ifeq ($(OS_ARCH),HP-UX) |
| 137 |
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir) |
| 138 |
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir) |
| 139 |
else |
| 140 |
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir) |
| 141 |
endif |
| 142 |
endif |