index 77fa960282d54a55571c403ea8b8445c700fc584..2c1938776e22a642303d941644d84ef46828928c 100644 (file)
--- a/program/netware/Makefile
+++ b/program/netware/Makefile
-# Gnu Makefile for NetWare target * 09-Sep-2006
+# Gnu Makefile for NetWare target
# for use with gcc/nlmconv or Metrowerks CodeWarrior compiler
# use with: make -f Makefile [help|all|clean|dev|devclean|dist|distclean]
+#
+# $id: $
+#
DESCR = Round Robin Database Tool $(RRD_VERSION_STR)
-COPYR = Copyright (c) 1997-2006 by Tobias Oetiker
+COPYR = Copyright (c) 1997-2009 by Tobias Oetiker
WWWURL = http://www.rrdtool.org/
MTSAFE = YES
#SCREEN = $(DESCR)
# All library code is statically linked to avoid problems with other lib NLMs.
# Edit the path below to point to your libpng sources or set environment var.
ifndef LIBPNG
-LIBPNG = $(LIBBASE)/libpng-1.2.12
+LIBPNG = $(LIBBASE)/libpng-1.2.32
endif
# Edit the path below to point to your freetype sources or set environment var.
ifndef LIBFT2
-LIBFT2 = $(LIBBASE)/freetype-2.2.1
+LIBFT2 = $(LIBBASE)/freetype-2.3.7
endif
# Edit the path below to point to your libart sources or set environment var.
ifndef LIBART
ifndef DISTDIR
DISTDIR = rrdtool-$(RRD_VERSION_STR)-nw
endif
-DISTARC = $(DISTDIR).zip
+ifndef DISTARC
+DISTARC = $(DISTDIR).$(ARCEXT)
+endif
# Edit the path below to point to your distribution folder.
ifndef DEVLDIR
DEVLDIR = rrdtool-$(RRD_VERSION_STR)-sdk-nw
endif
-DEVLARC = $(DEVLDIR).zip
+ifndef DEVLARC
+DEVLARC = $(DEVLDIR).$(ARCEXT)
+endif
# whatever...
# NO_NULL_REALLOC = 1
# Here you can find a native Win32 binary of the original awk:
# http://www.gknw.net/development/prgtools/awk.zip
AWK = awk
-ZIP = zip -qzR9
MV = mv -fv
+ifeq ($(ARCEXT),7z)
+ARCBIN = 7za a
+else
+ARCBIN = zip -qzr9
+ARCEXT = zip
+endif
+
# must be equal to DEBUG or NDEBUG
DB = NDEBUG
# DB = DEBUG
# Global flags for all compilers
CFLAGS = $(OPT) -D$(DB) -nostdinc -DNETWARE -DN_PLAT_NLM -D_POSIX_SOURCE
CFLAGS += -DHAVE_CONFIG_H
-
+
ifeq ($(CC),mwccnlm)
LD = mwldnlm
-LDFLAGS = -nostdlib $^ $(PRELUDE) $(LDLIBS) -o $@ -commandfile
+LDFLAGS = -nostdlib $^ $(PRELUDE) $(LDLIBS) -nlmversion=$(RRD_VERSION) -o $@ -commandfile
AR = $(LD)
-ARFLAGS = -type library -w nocmdline $(OBJS) -o
+ARFLAGS = -nostdlib -type library -o
LIBEXT = lib
+#RANLIB =
CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
CFLAGS += -relax_pointers
#CFLAGS += -w on,nounused,nounusedexpr # -ansi strict
AR = ar
ARFLAGS = -cq
LIBEXT = a
-CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return -fno-strict-aliasing
+RANLIB = ranlib
+CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing
CFLAGS += -Wall -Wno-unused -Wno-return-type # -pedantic
ifeq ($(LIBARCH),LIBC)
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
ifeq ($(MTSAFE),NO)
XDCOPT = -u
endif
-ifndef COPYR
- COPYR = Copyright (c) 2006 The Open Source Community.
-endif
ifndef DESCR
DESCR = $(notdir $(@:.def=)) Command Extension
endif
$(EOLIST)
XLIBOBJS = \
+ $(OBJDIR)/rrd_getopt.o \
+ $(OBJDIR)/rrd_getopt1.o \
$(OBJDIR)/art_rgba_svp.o \
- $(OBJDIR)/getopt.o \
- $(OBJDIR)/getopt1.o \
$(OBJDIR)/hash_32.o \
$(OBJDIR)/parsetime.o \
$(OBJDIR)/pngsize.o \
$(patsubst $(LIBART)/libart_lgpl/%.c,$(OBJDIR)/%.o,$(wildcard $(LIBART)/libart_lgpl/art_*.c))
OBJS := $(RRDLIBOBJS) $(XLIBOBJS) $(PNGLIBOBJS) $(ARTLIBOBJS) $(ZLIBOBJS)
-OBJCGI := $(OBJS) $(OBJDIR)/rrd_cgi.o
-OBJTOOL := $(OBJS) $(OBJDIR)/rrd_tool.o
-LDLIBS += $(LIBFT2)/builds/netware/libc/libft2.$(LIBEXT)
+LDLIBS += $(OBJDIR)/librrd.$(LIBEXT)
+LDLIBS += $(LIBFT2)/builds/netware/LIBC/libft2.$(LIBEXT)
all: rrdtool rrdcgi
-rrdtool: $(OBJDIR) $(PROOT)/rrd_config.h $(OBJDIR)/rrdtool.nlm
-rrdcgi: $(OBJDIR) $(PROOT)/rrd_config.h $(OBJDIR)/rrdcgi.$(CGIEXT)
librrd: $(OBJDIR) $(PROOT)/rrd_config.h $(OBJDIR)/librrd.$(LIBEXT)
+rrdcgi: librrd $(OBJDIR)/rrdcgi.$(CGIEXT)
+rrdtool: librrd $(OBJDIR)/rrdtool.nlm
+
+FORCE: ;
dist: all $(DISTDIR) $(DISTDIR)/readme.txt
-# @-$(CP) $(OBJDIR)/librrd.$(LIBEXT) $(DISTDIR)
@-$(CP) $(OBJDIR)/rrdcgi.$(CGIEXT) $(DISTDIR)
@-$(CP) $(OBJDIR)/rrdtool.nlm $(DISTDIR)
@-$(CP) $(PROOT)/src/*.ttf $(DISTDIR)
@-$(CP) $(PROOT)/NEWS $(DISTDIR)
@-$(CP) $(PROOT)/README $(DISTDIR)
@echo Creating $(DISTARC)
- @$(ZIP) $(DISTARC) $(DISTDIR)/* < $(DISTDIR)/readme.txt
+ @$(ARCBIN) $(DISTARC) $(DISTDIR)/* < $(DISTDIR)/readme.txt
dev: librrd $(DEVLDIR) $(DEVLDIR)/readme.txt
@-mkdir $(DEVLDIR)$(DS)include
@-$(CP) $(PROOT)/NEWS $(DEVLDIR)
@-$(CP) $(PROOT)/README $(DEVLDIR)
@echo Creating $(DEVLARC)
- @$(ZIP) $(DEVLARC) $(DEVLDIR)/* < $(DEVLDIR)/readme.txt
+ @$(ARCBIN) $(DEVLARC) $(DEVLDIR)/* < $(DEVLDIR)/readme.txt
clean:
-$(RM) -r $(OBJDIR)
@echo Compiling $<
@$(CC) $(CFLAGS) -c $< -o $@
-$(OBJDIR)/rrdcgi.$(CGIEXT): $(OBJCGI) $(OBJDIR)/rrdcgi.def $(OBJDIR)/rrdcgi.xdc
+$(OBJDIR)/rrdcgi.$(CGIEXT): $(OBJDIR)/rrd_cgi.o $(OBJDIR)/rrdcgi.def $(OBJDIR)/rrdcgi.xdc
@echo Linking $@
@-$(RM) $@
@$(LD) $(LDFLAGS) $(@:.$(CGIEXT)=.def)
-ifeq ($(LD),nlmconv)
- @$(MV) $(notdir $@) $@
-endif
-ifneq ($(CGIEXT),nlm)
ifeq ($(LD),mwldnlm)
+ifneq ($(CGIEXT),nlm)
@$(FIXNLMN) $@
endif
endif
-$(OBJDIR)/rrdtool.nlm: $(OBJTOOL) $(OBJDIR)/rrdtool.def $(OBJDIR)/rrdtool.xdc
+$(OBJDIR)/rrdtool.nlm: $(OBJDIR)/rrd_tool.o $(OBJDIR)/rrdtool.def $(OBJDIR)/rrdtool.xdc
@echo Linking $@
@-$(RM) $@
@$(LD) $(LDFLAGS) $(@:.nlm=.def)
-ifeq ($(LD),nlmconv)
- @$(MV) $(notdir $@) $@
-endif
$(OBJDIR)/librrd.$(LIBEXT): $(OBJS)
@echo Creating $@
@-$(RM) $@
@$(AR) $(ARFLAGS) $@ $^
+ifdef RANLIB
+ @$(RANLIB) $@
+endif
$(OBJDIR)/%.xdc: Makefile
@echo Creating $@
@echo $(DL)#$(DL) >> $@
@echo $(DL)copyright "$(COPYR)"$(DL) >> $@
@echo $(DL)description "$(DESCR)"$(DL) >> $@
+ifeq ($(LD),nlmconv)
@echo $(DL)version $(RRD_VERSION)$(DL) >> $@
+endif
ifdef NLMTYPE
@echo $(DL)type $(NLMTYPE)$(DL) >> $@
else
ifdef STACK
@echo $(DL)stack $(STACK)$(DL) >> $@
endif
- @echo $(DL)threadname "$(notdir $(@:.def=))"$(DL) >> $@
+ @echo $(DL)threadname "T_$(notdir $(@:.def=))"$(DL) >> $@
ifdef SCREEN
@echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
else
@echo $(DL)xdcdata $(@:.def=.xdc)$(DL) >> $@
endif
ifeq ($(LD),nlmconv)
- @echo $(DL)input $(OBJS) $(LDLIBS)$(DL) >> $@
+ @echo $(DL)input $(subst rrd,rrd_,$(@:.def=.o))$(DL) >> $@
+ @echo $(DL)input $(LDLIBS)$(DL) >> $@
@echo $(DL)input $(PRELUDE)$(DL) >> $@
- @echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
+ @echo $(DL)output $(@:.def=.nlm)$(DL) >> $@
endif
-$(PROOT)/rrd_config.h: Makefile
+$(PROOT)/rrd_config.h: FORCE Makefile $(OBJDIR)/version.inc
@echo Creating $@
@echo $(DL)/* $(notdir $@) for NetWare target.$(DL) > $@
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
@echo $(DL)#define HAVE_FLOAT_H 1$(DL) >> $@
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
+ @echo $(DL)#define HAVE_LIBGEN_H 1$(DL) >> $@
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
@echo $(DL)#define HAVE_LOCALE_H 1$(DL) >> $@
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
@echo $(DL)#define HAVE_SETLOCALE 1$(DL) >> $@
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
-# @echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
@echo $(DL)#define HAVE_SNPRINTF 1$(DL) >> $@
@echo $(DL)#define HAVE_STDARG_H 1$(DL) >> $@
@echo $(DL)#define HAVE_STDDEF_H 1$(DL) >> $@
endif
@echo $(DL)#define RRDGRAPH_YLEGEND_ANGLE $(RRDGRAPH_YLEGEND_ANGLE)$(DL) >> $@
ifdef WITH_PIECHART
- @echo $(DL)#define WITH_PIECHART 1$(DL) >> $@
+ @echo $(DL)#define WITH_PIECHART $(WITH_PIECHART)$(DL) >> $@
endif
@echo $(DL)#endif /* RRD_CONFIG_H */$(DL) >> $@