From 5c547aed9f8758f63378d61fc875676fa6288fa2 Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 29 Jan 2006 23:28:21 +0000 Subject: [PATCH] more makefile cleanup from Guenter Knauf gk gknw.de git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@755 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/Makefile.NetWare | 906 ++++++++++++++++++----------------- program/src/Makefile.Win32 | 96 ++-- 2 files changed, 528 insertions(+), 474 deletions(-) diff --git a/program/src/Makefile.NetWare b/program/src/Makefile.NetWare index 0b90973c..65251798 100644 --- a/program/src/Makefile.NetWare +++ b/program/src/Makefile.NetWare @@ -1,440 +1,466 @@ -# Gnu Makefile for NetWare target * 14-Jan-2006 -# for use with gcc/nlmconv or Metrowerks CodeWarrior compiler -# use with: make -f Makefile.NetWare [all|clean|dist] [BINEXT=cgi] - -# What to build -ifndef BINEXT -BINEXT = nlm -endif - -DESCR = Round Robin Database Tool $(RRD_VERSION_STR) -COPYR = Copyright (c) 1997-2006 by Tobias Oetiker -#WWWURL = http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/ -WWWURL = http://www.rrdtool.org/ -MTSAFE = YES -#SCREEN = $(TARGET) -STACK = 65535 -# Comment the line below if you dont want to load protected automatically. -#LDRING = 3 - -# Set the default font used in graphs. -RRD_DEFAULT_FONT = "arial.ttf" - -# Vertical label angle: 90.0 (default) or 270.0 -RRDGRAPH_YLEGEND_ANGLE = 90.0 - -# Edit the path below to point to your Novell NDK. -ifndef NDKBASE -NDKBASE = c:/novell -endif -# Edit the path below to point to your install destination. -# INSTDIR = /mnt/sys/mrtg/rrd -INSTDIR = s:/mrtg/rrd - -# Base for the lib sources -ifndef LIBBASE -LIBBASE = ../.. -endif -# 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.8 -endif -# Edit the path below to point to your freetype sources or set environment var. -ifndef LIBFT2 -LIBFT2 = $(LIBBASE)/freetype-2.1.9 -endif -# Edit the path below to point to your freetype sources or set environment var. -ifndef LIBART -LIBART = $(LIBBASE)/libart_lgpl-2.3.17 -endif -# Edit the path below to point to your zlib sources or set environment var. -ifndef ZLIBSDK -ZLIBSDK = $(LIBBASE)/zlib-1.2.3 -endif -# Edit the path below to point to your zlib sources or set environment var. -ifndef LIBCGI -LIBCGI = $(LIBBASE)/cgilib-0.5 -endif - -# whatever... -# NO_NULL_REALLOC = 1 - -# Edit the var below to point to your lib architecture. -ifndef LIBARCH -# LIBARCH = CLIB -LIBARCH = LIBC -endif - -# The following line defines your compiler. -ifdef METROWERKS - CC = mwccnlm -else - CC = gcc -endif -# RM = rm -f -CP = cp -afv -# if you want to mark the target as MTSAFE you will need a tool for -# generating the xdc data for the linker; here's a minimal tool: -# http://www.gknw.com/development/prgtools/mkxdc.zip -MPKXDC = mkxdc - -# must be equal to DEBUG or NDEBUG -DB = NDEBUG -# DB = DEBUG -# Optimization: -O or debugging: -g -ifeq ($(DB),NDEBUG) - OPT = -O2 - OBJDIR = release -else - OPT = -g - OBJDIR = debug -endif - -# Include the version info retrieved from source. --include $(OBJDIR)/version.inc - -# 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) $(OBJS) $(LDLIBS) -o $(OBJDIR)/$(TARGET).nlm -commandfile -LIBEXT = lib -CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586 -CFLAGS += -relax_pointers -#CFLAGS += -w on,nounused,nounusedexpr # -ansi strict -ifeq ($(LIBARCH),LIBC) - PRELUDE = $(SDK_LIBC)/imports/libcpre.o - CFLAGS += -align 4 -else - PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj" - CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h" - CFLAGS += -align 1 -endif -else -LD = nlmconv -LDFLAGS = -T -LIBEXT = a -CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return -fno-strict-aliasing -CFLAGS += -Wall -Wno-unused # -pedantic -ifeq ($(LIBARCH),LIBC) - PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o -else - PRELUDE = $(NDK_ROOT)/pre/prelude.o - CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h -endif -endif - -ifeq ($(findstring linux,$(OSTYPE)),linux) -#include $(NDKBASE)/nlmconv/ncpfs.inc -DL = ' -endif - -ifeq ($(MTSAFE),YES) - XDCOPT = -n -endif -ifeq ($(MTSAFE),NO) - XDCOPT = -u -endif -ifdef XDCOPT - XDCDATA = $(OBJDIR)/$(TARGET).xdc -endif -ifndef COPYR - COPYR = Copyright (c) 2006 The Open Source Community. -endif -ifndef DESCR - DESCR = $(TARGET) Command Extension -endif -DESCR += ($(LIBARCH)) - $(CC) build - -NDK_ROOT = $(NDKBASE)/ndk -SDK_CLIB = $(NDK_ROOT)/nwsdk -SDK_LIBC = $(NDK_ROOT)/libc - -INCLUDES = -I. -I$(LIBPNG) -I$(LIBFT2)/include -I$(LIBART) -I$(ZLIBSDK) -ifeq ($(BINEXT),cgi) -INCLUDES += -I$(LIBCGI) -endif -ifeq ($(LIBARCH),LIBC) - INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks -else - INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include -endif - -CFLAGS += $(INCLUDES) - -vpath %.c . $(LIBPNG) $(LIBART)/libart_lgpl $(ZLIBSDK) $(LIBCGI) - -RRDLIBOBJS = \ - $(OBJDIR)/rrd_afm.o \ - $(OBJDIR)/rrd_afm_data.o \ - $(OBJDIR)/rrd_create.o \ - $(OBJDIR)/rrd_diff.o \ - $(OBJDIR)/rrd_dump.o \ - $(OBJDIR)/rrd_error.o \ - $(OBJDIR)/rrd_fetch.o \ - $(OBJDIR)/rrd_first.o \ - $(OBJDIR)/rrd_format.o \ - $(OBJDIR)/rrd_gfx.o \ - $(OBJDIR)/rrd_graph.o \ - $(OBJDIR)/rrd_graph_helper.o \ - $(OBJDIR)/rrd_hw.o \ - $(OBJDIR)/rrd_info.o \ - $(OBJDIR)/rrd_last.o \ - $(OBJDIR)/rrd_nan_inf.o \ - $(OBJDIR)/rrd_open.o \ - $(OBJDIR)/rrd_resize.o \ - $(OBJDIR)/rrd_restore.o \ - $(OBJDIR)/rrd_rpncalc.o \ - $(OBJDIR)/rrd_tune.o \ - $(OBJDIR)/rrd_update.o \ - $(OBJDIR)/rrd_version.o \ - $(OBJDIR)/rrd_xport.o \ - $(OBJDIR)/rrd_thread_safe.o \ - $(EOLIST) - -XLIBOBJS = \ - $(OBJDIR)/art_rgba_svp.o \ - $(OBJDIR)/getopt.o \ - $(OBJDIR)/getopt1.o \ - $(OBJDIR)/hash_32.o \ - $(OBJDIR)/parsetime.o \ - $(OBJDIR)/pngsize.o \ - $(EOLIST) - -PNGLIBOBJS = \ - $(OBJDIR)/png.o \ - $(OBJDIR)/pngerror.o \ - $(OBJDIR)/pngget.o \ - $(OBJDIR)/pngmem.o \ - $(OBJDIR)/pngpread.o \ - $(OBJDIR)/pngread.o \ - $(OBJDIR)/pngrio.o \ - $(OBJDIR)/pngrtran.o \ - $(OBJDIR)/pngrutil.o \ - $(OBJDIR)/pngset.o \ - $(OBJDIR)/pngtrans.o \ - $(OBJDIR)/pngwio.o \ - $(OBJDIR)/pngwrite.o \ - $(OBJDIR)/pngwtran.o \ - $(OBJDIR)/pngwutil.o \ - $(EOLIST) -ifeq "$(wildcard $(LIBPNG)/pnggccrd.c)" "$(LIBPNG)/pnggccrd.c" -PNGLIBOBJS += \ - $(OBJDIR)/pnggccrd.o \ - $(OBJDIR)/pngvcrd.o \ - $(EOLIST) -endif - -ZLIBOBJS = \ - $(OBJDIR)/adler32.o \ - $(OBJDIR)/compress.o \ - $(OBJDIR)/crc32.o \ - $(OBJDIR)/deflate.o \ - $(OBJDIR)/inflate.o \ - $(OBJDIR)/inffast.o \ - $(OBJDIR)/inftrees.o \ - $(OBJDIR)/trees.o \ - $(OBJDIR)/zutil.o \ - $(EOLIST) -ifeq "$(wildcard $(ZLIBSDK)/infblock.c)" "$(ZLIBSDK)/infblock.c" -ZLIBOBJS += \ - $(OBJDIR)/infblock.o \ - $(OBJDIR)/infcodes.o \ - $(OBJDIR)/infutil.o \ - $(EOLIST) -endif - -CGIOBJS = \ - $(OBJDIR)/cgi.o \ - $(OBJDIR)/cookies.o \ - $(EOLIST) - -ARTLIBOBJS = \ - $(patsubst $(LIBART)/libart_lgpl/%.c,$(OBJDIR)/%.o,$(wildcard $(LIBART)/libart_lgpl/art_*.c)) - -OBJS = $(RRDLIBOBJS) $(XLIBOBJS) $(PNGLIBOBJS) $(ARTLIBOBJS) $(ZLIBOBJS) - -ifeq ($(BINEXT),cgi) -OBJS += $(CGIOBJS) $(OBJDIR)/rrd_cgi.o -TARGET = rrdcgi -else -OBJS += $(OBJDIR)/rrd_tool.o -TARGET = rrdtool -endif - -LDLIBS += $(LIBFT2)/builds/netware/libc/libft2.$(LIBEXT) - - -all: $(OBJDIR) config.h $(OBJDIR)/$(TARGET).$(BINEXT) - -dist: all - -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv - -$(RM) $(OBJDIR)/$(TARGET).def $(XDCDATA) - -$(RM) config.h - -install: all - @[ -d $(INSTDIR) ] || mkdir $(INSTDIR) - @$(CP) $(TARGET).$(BINEXT) $(INSTDIR) - -clean: - -$(RM) -r $(OBJDIR) - -$(RM) config.h - -$(OBJDIR): - @mkdir $(OBJDIR) - -$(OBJDIR)/%.o: %.c - @echo Compiling $< - @$(CC) $(CFLAGS) -c $< -o $@ - -$(OBJDIR)/version.inc: ../configure.ac $(OBJDIR) get_ver.awk - @echo Creating $@ - @awk -f get_ver.awk $< > $@ - -$(OBJDIR)/$(TARGET).$(BINEXT): $(OBJDIR) $(OBJS) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).def $(XDCDATA) - @echo Linking $@ - @-$(RM) $@ - @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def - -$(OBJDIR)/%.xdc: Makefile.NetWare - @echo Creating $@ - @$(MPKXDC) $(XDCOPT) $@ - -$(OBJDIR)/%.def: Makefile.NetWare $(OBJDIR)/version.inc - @echo $(DL)# DEF Linker File for use with gcc and nlmconv$(DL) > $@ - @echo $(DL)# or with Codewarrior command line compiler.$(DL) >> $@ - @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@ - @echo $(DL)# All your changes will be lost!!$(DL) >> $@ - @echo $(DL)#$(DL) >> $@ - @echo $(DL)copyright "$(COPYR)"$(DL) >> $@ - @echo $(DL)description "$(DESCR)"$(DL) >> $@ - @echo $(DL)version $(RRD_VERSION)$(DL) >> $@ -ifdef NLMTYPE - @echo $(DL)type $(NLMTYPE)$(DL) >> $@ -else - @echo $(DL)type 0$(DL) >> $@ -endif -ifdef STACK - @echo $(DL)stack $(STACK)$(DL) >> $@ -endif - @echo $(DL)threadname "$(TARGET)"$(DL) >> $@ -ifdef SCREEN - @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@ -else - @echo $(DL)screenname "DEFAULT"$(DL) >> $@ -endif -ifeq ($(DB),DEBUG) - @echo $(DL)debug$(DL) >> $@ -endif -ifeq ($(LIBARCH),CLIB) - @echo $(DL)start _Prelude$(DL) >> $@ - @echo $(DL)exit _Stop$(DL) >> $@ - @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/clib.imp$(DL) >> $@ - @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/threads.imp$(DL) >> $@ - @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/nlmlib.imp$(DL) >> $@ - @echo $(DL)module clib$(DL) >> $@ -else - @echo $(DL)start _LibCPrelude$(DL) >> $@ - @echo $(DL)exit _LibCPostlude$(DL) >> $@ - @echo $(DL)check _LibCCheckUnload$(DL) >> $@ - @echo $(DL)import @$(NDK_ROOT)/libc/imports/libc.imp$(DL) >> $@ - @echo $(DL)import @$(NDK_ROOT)/libc/imports/netware.imp$(DL) >> $@ - @echo $(DL)module libc$(DL) >> $@ - @echo $(DL)pseudopreemption$(DL) >> $@ - @echo $(DL)flag_on 64$(DL) >> $@ -endif -ifeq ($(LDRING),0) - @echo $(DL)flag_on 16$(DL) >> $@ -endif -ifeq ($(LDRING),3) - @echo $(DL)flag_on 512$(DL) >> $@ -endif -ifdef XDCDATA - @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@ -endif -ifeq ($(LD),nlmconv) - @echo $(DL)input $(OBJS) $(LDLIBS)$(DL) >> $@ - @echo $(DL)input $(PRELUDE)$(DL) >> $@ - @echo $(DL)output $(TARGET).nlm$(DL) >> $@ -endif - -config.h: Makefile.NetWare - @echo Creating $@ - @echo $(DL)/* $@ for NetWare target.$(DL) > $@ - @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@ - @echo $(DL)** All your changes will be lost!!$(DL) >> $@ - @echo $(DL)*/$(DL) >> $@ - @echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@ - @echo $(DL)#define PACKAGE_VERSION "$(RRD_VERSION_STR)"$(DL) >> $@ - @echo $(DL)#define PACKAGE_BUGREPORT "tobi@oetiker.ch"$(DL) >> $@ - @echo $(DL)#define NUMVERS $(RRD_NUMVERS)$(DL) >> $@ - @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@ - @echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_ERRNO_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_FIONBIO 1$(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_LIMITS_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@ - @echo $(DL)#define HAVE_LOCALE_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_MATH_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_MBSTOWCS 1$(DL) >> $@ - @echo $(DL)#define HAVE_MEMMOVE 1$(DL) >> $@ - @echo $(DL)#define HAVE_MKTIME 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) >> $@ - @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@ - @echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@ - @echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@ - @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@ - @echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@ - @echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@ - @echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_TZSET 1$(DL) >> $@ - @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@ - @echo $(DL)#define HAVE_VPRINTF 1$(DL) >> $@ - @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@ - @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@ - @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@ - @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@ - @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@ -ifdef NO_NULL_REALLOC - @echo $(DL)#define NO_NULL_REALLOC 1$(DL) >> $@ - @echo $(DL)#define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) ))$(DL) >> $@ -else - @echo $(DL)#define rrd_realloc(a,b) realloc((a), (b))$(DL) >> $@ -endif - @echo $(DL)#define RRDGRAPH_YLEGEND_ANGLE $(RRDGRAPH_YLEGEND_ANGLE)$(DL) >> $@ - @echo $(DL)#define RRD_DEFAULT_FONT $(RRD_DEFAULT_FONT)$(DL) >> $@ - -$(OBJDIR)/readme.txt: Makefile.NetWare - @echo Creating $@ - @echo $(DL)This is a binary distribution for NetWare platform.$(DL) > $@ - @echo $(DL)MRTG rrdtool version $(RRD_VERSION_STR)$(DL) >> $@ - @echo $(DL)Please download the complete RRD package for$(DL) >> $@ - @echo $(DL)any further documentation:$(DL) >> $@ - @echo $(DL)http://www.rrdtool.org/$(DL) >> $@ - - +# Gnu Makefile for NetWare target * 29-Jan-2006 +# for use with gcc/nlmconv or Metrowerks CodeWarrior compiler +# use with: make -f Makefile.NetWare [all|clean|dist] + +DESCR = Round Robin Database Tool $(RRD_VERSION_STR) +COPYR = Copyright (c) 1997-2006 by Tobias Oetiker +#WWWURL = http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/ +WWWURL = http://www.rrdtool.org/ +MTSAFE = YES +#SCREEN = $(DESCR) +STACK = 65535 +# Comment the line below if you dont want to load protected automatically. +#LDRING = 3 + +# Set the default font used in graphs. +ifndef RRD_DEFAULT_FONT +#RRD_DEFAULT_FONT = "sys:/java/nwgfx/lib/x11/fonts/ttf/tt0003m_.ttf" +#RRD_DEFAULT_FONT = "DejaVuSansMono-Roman.ttf" +RRD_DEFAULT_FONT = "VeraMono.ttf" +endif + +# Vertical label angle: 90.0 (default) or 270.0 +RRDGRAPH_YLEGEND_ANGLE = 90.0 + +# Set to one if you want to have piecharts. +WITH_PIECHART = 1 + +# Edit the path below to point to your Novell NDK. +ifndef NDKBASE +NDKBASE = c:/novell +endif +# Edit the path below to point to your install destination. +# INSTDIR = /mnt/sys/mrtg/rrd +INSTDIR = s:/rrdtool + +# Base for the lib sources +ifndef LIBBASE +LIBBASE = ../.. +endif +# 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.8 +endif +# Edit the path below to point to your freetype sources or set environment var. +ifndef LIBFT2 +LIBFT2 = $(LIBBASE)/freetype-2.1.9 +endif +# Edit the path below to point to your freetype sources or set environment var. +ifndef LIBART +LIBART = $(LIBBASE)/libart_lgpl-2.3.17 +endif +# Edit the path below to point to your zlib sources or set environment var. +ifndef ZLIBSDK +ZLIBSDK = $(LIBBASE)/zlib-1.2.3 +endif +# Edit the path below to point to your zlib sources or set environment var. +ifndef LIBCGI +LIBCGI = $(LIBBASE)/cgilib-0.5 +endif + +# whatever... +# NO_NULL_REALLOC = 1 + +# Edit the var below to point to your lib architecture. +ifndef LIBARCH +# LIBARCH = CLIB +LIBARCH = LIBC +endif + +# The following line defines your compiler. +ifdef METROWERKS + CC = mwccnlm +else + CC = gcc +endif +# RM = rm -f +CP = cp -afv +# if you want to mark the target as MTSAFE you will need a tool for +# generating the xdc data for the linker; here's a minimal tool: +# http://www.gknw.com/development/prgtools/mkxdc.zip +MPKXDC = mkxdc + +ZIP = zip -qzR9 +ARCHIVE = rrdtool-$(RRD_VERSION_STR)-nw.zip + +# must be equal to DEBUG or NDEBUG +DB = NDEBUG +# DB = DEBUG +# Optimization: -O or debugging: -g +ifeq ($(DB),NDEBUG) + OPT = -O2 + OBJDIR = release +else + OPT = -g + OBJDIR = debug +endif + +# Include the version info retrieved from source. +-include $(OBJDIR)/version.inc + +# 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 +AR = $(LD) +ARFLAGS = -type library -w nocmdline $(OBJS) -o +LIBEXT = lib +CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586 +CFLAGS += -relax_pointers +#CFLAGS += -w on,nounused,nounusedexpr # -ansi strict +ifeq ($(LIBARCH),LIBC) + PRELUDE = $(SDK_LIBC)/imports/libcpre.o + CFLAGS += -align 4 +else + PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj" + CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h" + CFLAGS += -align 1 +endif +else +LD = nlmconv +LDFLAGS = -T +AR = ar +ARFLAGS = -cq +LIBEXT = a +CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return -fno-strict-aliasing +CFLAGS += -Wall -Wno-unused # -pedantic +ifeq ($(LIBARCH),LIBC) + PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o +else + PRELUDE = $(NDK_ROOT)/pre/prelude.o + CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h +endif +endif + +ifeq ($(findstring linux,$(OSTYPE)),linux) +#include $(NDKBASE)/nlmconv/ncpfs.inc +DL = ' +endif + +ifeq ($(MTSAFE),YES) + XDCOPT = -n +endif +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 +DESCR += ($(LIBARCH)) - $(CC) build + +NDK_ROOT = $(NDKBASE)/ndk +SDK_CLIB = $(NDK_ROOT)/nwsdk +SDK_LIBC = $(NDK_ROOT)/libc + +INCLUDES = -I. -I$(LIBPNG) -I$(LIBFT2)/include -I$(LIBART) -I$(ZLIBSDK) -I$(LIBCGI) + +ifeq ($(LIBARCH),LIBC) + INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks +else + INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include +endif + +CFLAGS += $(INCLUDES) + +vpath %.c . $(LIBPNG) $(LIBART)/libart_lgpl $(ZLIBSDK) $(LIBCGI) + +RRDLIBOBJS = \ + $(OBJDIR)/rrd_afm.o \ + $(OBJDIR)/rrd_afm_data.o \ + $(OBJDIR)/rrd_create.o \ + $(OBJDIR)/rrd_diff.o \ + $(OBJDIR)/rrd_dump.o \ + $(OBJDIR)/rrd_error.o \ + $(OBJDIR)/rrd_fetch.o \ + $(OBJDIR)/rrd_first.o \ + $(OBJDIR)/rrd_format.o \ + $(OBJDIR)/rrd_gfx.o \ + $(OBJDIR)/rrd_graph.o \ + $(OBJDIR)/rrd_graph_helper.o \ + $(OBJDIR)/rrd_hw.o \ + $(OBJDIR)/rrd_info.o \ + $(OBJDIR)/rrd_last.o \ + $(OBJDIR)/rrd_nan_inf.o \ + $(OBJDIR)/rrd_open.o \ + $(OBJDIR)/rrd_resize.o \ + $(OBJDIR)/rrd_restore.o \ + $(OBJDIR)/rrd_rpncalc.o \ + $(OBJDIR)/rrd_tune.o \ + $(OBJDIR)/rrd_update.o \ + $(OBJDIR)/rrd_version.o \ + $(OBJDIR)/rrd_xport.o \ + $(OBJDIR)/rrd_thread_safe.o \ + $(EOLIST) + +XLIBOBJS = \ + $(OBJDIR)/art_rgba_svp.o \ + $(OBJDIR)/getopt.o \ + $(OBJDIR)/getopt1.o \ + $(OBJDIR)/hash_32.o \ + $(OBJDIR)/parsetime.o \ + $(OBJDIR)/pngsize.o \ + $(EOLIST) + +PNGLIBOBJS = \ + $(OBJDIR)/png.o \ + $(OBJDIR)/pngerror.o \ + $(OBJDIR)/pngget.o \ + $(OBJDIR)/pngmem.o \ + $(OBJDIR)/pngpread.o \ + $(OBJDIR)/pngread.o \ + $(OBJDIR)/pngrio.o \ + $(OBJDIR)/pngrtran.o \ + $(OBJDIR)/pngrutil.o \ + $(OBJDIR)/pngset.o \ + $(OBJDIR)/pngtrans.o \ + $(OBJDIR)/pngwio.o \ + $(OBJDIR)/pngwrite.o \ + $(OBJDIR)/pngwtran.o \ + $(OBJDIR)/pngwutil.o \ + $(EOLIST) +ifeq "$(wildcard $(LIBPNG)/pnggccrd.c)" "$(LIBPNG)/pnggccrd.c" +PNGLIBOBJS += \ + $(OBJDIR)/pnggccrd.o \ + $(OBJDIR)/pngvcrd.o \ + $(EOLIST) +endif + +ZLIBOBJS = \ + $(OBJDIR)/adler32.o \ + $(OBJDIR)/compress.o \ + $(OBJDIR)/crc32.o \ + $(OBJDIR)/deflate.o \ + $(OBJDIR)/inflate.o \ + $(OBJDIR)/inffast.o \ + $(OBJDIR)/inftrees.o \ + $(OBJDIR)/trees.o \ + $(OBJDIR)/zutil.o \ + $(EOLIST) +ifeq "$(wildcard $(ZLIBSDK)/infblock.c)" "$(ZLIBSDK)/infblock.c" +ZLIBOBJS += \ + $(OBJDIR)/infblock.o \ + $(OBJDIR)/infcodes.o \ + $(OBJDIR)/infutil.o \ + $(EOLIST) +endif + +CGILIBOBJS = \ + $(OBJDIR)/cgi.o \ + $(OBJDIR)/cookies.o \ + $(EOLIST) + +ARTLIBOBJS = \ + $(patsubst $(LIBART)/libart_lgpl/%.c,$(OBJDIR)/%.o,$(wildcard $(LIBART)/libart_lgpl/art_*.c)) + +OBJS := $(RRDLIBOBJS) $(XLIBOBJS) $(PNGLIBOBJS) $(ARTLIBOBJS) $(ZLIBOBJS) +OBJCGI := $(OBJS) $(CGILIBOBJS) $(OBJDIR)/rrd_cgi.o +OBJTOOL := $(OBJS) $(OBJDIR)/rrd_tool.o + +LDLIBS += $(LIBFT2)/builds/netware/libc/libft2.$(LIBEXT) + + +all: rrdtool rrdcgi + +rrdtool: $(OBJDIR) config.h $(OBJDIR)/rrdtool.nlm +rrdcgi: $(OBJDIR) config.h $(OBJDIR)/rrdcgi.nlm +librrd: $(OBJDIR) config.h $(OBJDIR)/librrd.$(LIBEXT) + +dist: all $(OBJDIR)/readme.txt + -$(RM) $(OBJDIR)/*.o $(OBJDIR)/*.map $(OBJDIR)/*.ncv + -$(RM) $(OBJDIR)/*.def $(OBJDIR)/*.xdc + -$(RM) $(OBJDIR)/version.inc + @-$(CP) $(RRD_DEFAULT_FONT) $(OBJDIR) + @-$(CP) ../CHANGES $(OBJDIR) + @-$(CP) ../COPYING $(OBJDIR) + @-$(CP) ../COPYRIGHT $(OBJDIR) + @-$(CP) ../NEWS $(OBJDIR) + @-$(CP) ../README $(OBJDIR) + @echo Creating $(ARCHIVE) + @$(ZIP) $(ARCHIVE) $(OBJDIR)/* < $(OBJDIR)/readme.txt + +install: all + @[ -d $(INSTDIR) ] || mkdir $(INSTDIR) + @$(CP) $(OBJDIR)/*.nlm $(INSTDIR) + +clean: + -$(RM) -r $(OBJDIR) + -$(RM) config.h + +cleandist: clean + -$(RM) $(ARCHIVE) + +$(OBJDIR): + @mkdir $(OBJDIR) + +$(OBJDIR)/%.o: %.c + @echo Compiling $< + @$(CC) $(CFLAGS) -c $< -o $@ + +$(OBJDIR)/version.inc: ../configure.ac $(OBJDIR) get_ver.awk + @echo Creating $@ + @awk -f get_ver.awk $< > $@ + +$(OBJDIR)/rrdcgi.nlm: $(OBJCGI) $(OBJDIR)/rrdcgi.def $(OBJDIR)/rrdcgi.xdc + @echo Linking $@ + @-$(RM) $@ + @$(LD) $(LDFLAGS) $(@:.nlm=.def) + +$(OBJDIR)/rrdtool.nlm: $(OBJTOOL) $(OBJDIR)/rrdtool.def $(OBJDIR)/rrdtool.xdc + @echo Linking $@ + @-$(RM) $@ + @$(LD) $(LDFLAGS) $(@:.nlm=.def) + +$(OBJDIR)/librrd.$(LIBEXT): $(OBJS) + @echo Creating $@ + @-$(RM) $@ + @$(AR) $(ARFLAGS) $@ $^ + +$(OBJDIR)/%.xdc: Makefile.NetWare + @echo Creating $@ + @$(MPKXDC) $(XDCOPT) $@ + +$(OBJDIR)/%.def: Makefile.NetWare $(OBJDIR)/version.inc + @echo $(DL)# DEF Linker File for use with gcc and nlmconv$(DL) > $@ + @echo $(DL)# or with Codewarrior command line compiler.$(DL) >> $@ + @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@ + @echo $(DL)# All your changes will be lost!!$(DL) >> $@ + @echo $(DL)#$(DL) >> $@ + @echo $(DL)copyright "$(COPYR)"$(DL) >> $@ + @echo $(DL)description "$(DESCR)"$(DL) >> $@ + @echo $(DL)version $(RRD_VERSION)$(DL) >> $@ +ifdef NLMTYPE + @echo $(DL)type $(NLMTYPE)$(DL) >> $@ +else + @echo $(DL)type 0$(DL) >> $@ +endif +ifdef STACK + @echo $(DL)stack $(STACK)$(DL) >> $@ +endif + @echo $(DL)threadname "$(notdir $(@:.def=))"$(DL) >> $@ +ifdef SCREEN + @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@ +else + @echo $(DL)screenname "DEFAULT"$(DL) >> $@ +endif +ifeq ($(DB),DEBUG) + @echo $(DL)debug$(DL) >> $@ +endif +ifeq ($(LIBARCH),CLIB) + @echo $(DL)start _Prelude$(DL) >> $@ + @echo $(DL)exit _Stop$(DL) >> $@ + @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/clib.imp$(DL) >> $@ + @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/threads.imp$(DL) >> $@ + @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/nlmlib.imp$(DL) >> $@ + @echo $(DL)module clib$(DL) >> $@ +else + @echo $(DL)start _LibCPrelude$(DL) >> $@ + @echo $(DL)exit _LibCPostlude$(DL) >> $@ + @echo $(DL)check _LibCCheckUnload$(DL) >> $@ + @echo $(DL)import @$(NDK_ROOT)/libc/imports/libc.imp$(DL) >> $@ + @echo $(DL)import @$(NDK_ROOT)/libc/imports/netware.imp$(DL) >> $@ + @echo $(DL)module libc$(DL) >> $@ + @echo $(DL)pseudopreemption$(DL) >> $@ + @echo $(DL)flag_on 64$(DL) >> $@ +endif +ifeq ($(LDRING),0) + @echo $(DL)flag_on 16$(DL) >> $@ +endif +ifeq ($(LDRING),3) + @echo $(DL)flag_on 512$(DL) >> $@ +endif +ifdef XDCOPT + @echo $(DL)xdcdata $(@:.def=.xdc)$(DL) >> $@ +endif +ifeq ($(LD),nlmconv) + @echo $(DL)input $(OBJS) $(LDLIBS)$(DL) >> $@ + @echo $(DL)input $(PRELUDE)$(DL) >> $@ + @echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@ +endif + +config.h: Makefile.NetWare + @echo Creating $@ + @echo $(DL)/* $@ for NetWare target.$(DL) > $@ + @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@ + @echo $(DL)** All your changes will be lost!!$(DL) >> $@ + @echo $(DL)*/$(DL) >> $@ + @echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@ + @echo $(DL)#define PACKAGE_VERSION "$(RRD_VERSION_STR)"$(DL) >> $@ + @echo $(DL)#define PACKAGE_BUGREPORT "tobi@oetiker.ch"$(DL) >> $@ + @echo $(DL)#define NUMVERS $(RRD_NUMVERS)$(DL) >> $@ + @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@ + @echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_ERRNO_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_FIONBIO 1$(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_LIMITS_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@ + @echo $(DL)#define HAVE_LOCALE_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_MATH_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_MBSTOWCS 1$(DL) >> $@ + @echo $(DL)#define HAVE_MEMMOVE 1$(DL) >> $@ + @echo $(DL)#define HAVE_MKTIME 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) >> $@ + @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@ + @echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_TZSET 1$(DL) >> $@ + @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@ + @echo $(DL)#define HAVE_VPRINTF 1$(DL) >> $@ + @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@ + @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@ + @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@ + @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@ +ifdef NO_NULL_REALLOC + @echo $(DL)#define NO_NULL_REALLOC 1$(DL) >> $@ + @echo $(DL)#define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) ))$(DL) >> $@ +else + @echo $(DL)#define rrd_realloc(a,b) realloc((a), (b))$(DL) >> $@ +endif + @echo $(DL)#define RRDGRAPH_YLEGEND_ANGLE $(RRDGRAPH_YLEGEND_ANGLE)$(DL) >> $@ + @echo $(DL)#define RRD_DEFAULT_FONT $(RRD_DEFAULT_FONT)$(DL) >> $@ +ifdef WITH_PIECHART + @echo $(DL)#define WITH_PIECHART 1$(DL) >> $@ +endif + +$(OBJDIR)/readme.txt: Makefile.NetWare + @echo Creating $@ + @echo $(DL)This is a binary distribution for NetWare platform.$(DL) > $@ + @echo $(DL)RRDTool version $(RRD_VERSION_STR)$(DL) >> $@ + @echo $(DL)Please download the complete RRDTool package for$(DL) >> $@ + @echo $(DL)any further documentation:$(DL) >> $@ + @echo $(DL)http://www.rrdtool.org/$(DL) >> $@ + + diff --git a/program/src/Makefile.Win32 b/program/src/Makefile.Win32 index 7d1908a1..39e5eded 100644 --- a/program/src/Makefile.Win32 +++ b/program/src/Makefile.Win32 @@ -1,11 +1,6 @@ -# Gnu Makefile for Win32 target * 14-Jan-2006 +# Gnu Makefile for Win32 target * 29-Jan-2006 # for use with MingW32 gcc or Metrowerks CodeWarrior compiler -# use with: make -f Makefile.Win32 [all|clean|dist] [BINEXT=cgi] - -# What to build -ifndef BINEXT -BINEXT = exe -endif +# use with: make -f Makefile.Win32 [all|clean|dist] DESCR = Round Robin Database Tool COPYR = Copyright (c) 1997-2006 by Tobias Oetiker @@ -14,13 +9,20 @@ WWWURL = http://www.rrdtool.org/ ICON = ../favicon.ico # Set the default font used in graphs. +ifndef RRD_DEFAULT_FONT RRD_DEFAULT_FONT = "arial.ttf" +#RRD_DEFAULT_FONT = "DejaVuSansMono-Roman.ttf" +#RRD_DEFAULT_FONT = "VeraMono.ttf" +endif # Vertical label angle: 90.0 (default) or 270.0 RRDGRAPH_YLEGEND_ANGLE = 90.0 +# Set to one if you want to have piecharts. +WITH_PIECHART = 1 + # Edit the path below to point to your install destination. -INSTDIR = c:/mrtg/rrd +INSTDIR = c:/rrdtool # Base for the lib sources ifndef LIBBASE @@ -61,6 +63,9 @@ endif # RM = rm -f CP = cp -afv +ZIP = zip -qzR9 +ARCHIVE = rrdtool-$(RRD_VERSION_STR)-w32.zip + # must be equal to DEBUG or NDEBUG DB = NDEBUG # DB = DEBUG @@ -83,6 +88,8 @@ ifeq ($(CC),mwcc) LD = mwld RC = mwwinrc LDFLAGS = -nostdlib +AR = $(LD) +ARFLAGS = -type library -w nocmdline $(OBJS) -o LIBEXT = lib LIBPATH += -lr "$(METROWERKS)/MSL" -lr "$(METROWERKS)/Win32-x86 Support" LDLIBS += -lkernel32.lib -luser32.lib @@ -95,6 +102,8 @@ else LD = gcc RC = windres LDFLAGS = -s +AR = ar +ARFLAGS = -cq LIBEXT = a RCFLAGS = -I rc -O coff -i CFLAGS += -fno-strict-aliasing -Wall -Wno-unused # -pedantic @@ -104,14 +113,11 @@ ifndef COPYR COPYR = Copyright (c) 2006 The Open Source Community. endif ifndef DESCR - DESCR = $(TARGET) Command Extension + DESCR = $(notdir $(@:.rc=)) Command Extension endif DESCR += - $(CC) build -INCLUDES += -I. -I$(LIBPNG) -I$(LIBFT2)/include -I$(LIBART) -I$(ZLIBSDK) -ifeq ($(BINEXT),cgi) -INCLUDES += -I$(LIBCGI) -endif +INCLUDES += -I. -I$(LIBPNG) -I$(LIBFT2)/include -I$(LIBART) -I$(ZLIBSDK) -I$(LIBCGI) CFLAGS += $(INCLUDES) @@ -198,7 +204,7 @@ ZLIBOBJS += \ $(EOLIST) endif -CGIOBJS = \ +CGILIBOBJS = \ $(OBJDIR)/cgi.o \ $(OBJDIR)/cookies.o \ $(EOLIST) @@ -206,33 +212,42 @@ CGIOBJS = \ ARTLIBOBJS = \ $(patsubst $(LIBART)/libart_lgpl/%.c,$(OBJDIR)/%.o,$(wildcard $(LIBART)/libart_lgpl/art_*.c)) -OBJS = $(RRDLIBOBJS) $(XLIBOBJS) $(PNGLIBOBJS) $(ARTLIBOBJS) $(ZLIBOBJS) - -ifeq ($(BINEXT),cgi) -OBJS += $(CGIOBJS) $(OBJDIR)/rrd_cgi.o -TARGET = rrdcgi -else -OBJS += $(OBJDIR)/rrd_tool.o -TARGET = rrdtool -endif +OBJS := $(RRDLIBOBJS) $(XLIBOBJS) $(PNGLIBOBJS) $(ARTLIBOBJS) $(ZLIBOBJS) +OBJCGI := $(OBJS) $(CGILIBOBJS) $(OBJDIR)/rrd_cgi.o +OBJTOOL := $(OBJS) $(OBJDIR)/rrd_tool.o LDLIBS += $(LIBFT2)/objs/freetype.$(LIBEXT) -all: $(OBJDIR) config.h $(OBJDIR)/$(TARGET).$(BINEXT) +all: rrdtool rrdcgi + +rrdtool: $(OBJDIR) config.h $(OBJDIR)/rrdtool.exe +rrdcgi: $(OBJDIR) config.h $(OBJDIR)/rrdcgi.exe +librrd: $(OBJDIR) config.h $(OBJDIR)/librrd.$(LIBEXT) -dist: all - -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv - -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/$(TARGET).res +dist: all $(OBJDIR)/readme.txt + -$(RM) $(OBJDIR)/*.o $(OBJDIR)/*.map $(OBJDIR)/*.ncv + -$(RM) $(OBJDIR)/*.def $(OBJDIR)/*.res $(OBJDIR)/*.rc + -$(RM) $(OBJDIR)/version.inc + @-$(CP) ../CHANGES $(OBJDIR) + @-$(CP) ../COPYING $(OBJDIR) + @-$(CP) ../COPYRIGHT $(OBJDIR) + @-$(CP) ../NEWS $(OBJDIR) + @-$(CP) ../README $(OBJDIR) + @echo Creating $(ARCHIVE) + @$(ZIP) $(ARCHIVE) $(OBJDIR)/* < $(OBJDIR)/readme.txt install: all @[ -d $(INSTDIR) ] || mkdir $(INSTDIR) - @$(CP) $(TARGET).$(BINEXT) $(INSTDIR) + @$(CP) $(OBJDIR)/*.exe $(INSTDIR) clean: -$(RM) -r $(OBJDIR) -$(RM) config.h +cleandist: clean + -$(RM) $(ARCHIVE) + $(OBJDIR): @mkdir $(OBJDIR) @@ -244,11 +259,21 @@ $(OBJDIR)/%.o: %.c @echo Compiling $< @$(CC) $(CFLAGS) -c $< -o $@ -$(OBJDIR)/$(TARGET).$(BINEXT): $(OBJS) $(OBJDIR)/$(TARGET).res +$(OBJDIR)/rrdcgi.exe: $(OBJCGI) $(OBJDIR)/rrdcgi.res + @echo Linking $@ + @-$(RM) $@ + @$(LD) $(LDFLAGS) $^ -o $@ $(LIBPATH) $(LDLIBS) + +$(OBJDIR)/rrdtool.exe: $(OBJTOOL) $(OBJDIR)/rrdtool.res @echo Linking $@ @-$(RM) $@ @$(LD) $(LDFLAGS) $^ -o $@ $(LIBPATH) $(LDLIBS) +$(OBJDIR)/librrd.$(LIBEXT): $(OBJS) + @echo Creating $@ + @-$(RM) $@ + @$(AR) $(ARFLAGS) $@ $^ + $(OBJDIR)/%.res: $(OBJDIR)/%.rc @echo Creating $@ @$(RC) $(RCFLAGS) $< -o $@ @@ -269,13 +294,13 @@ $(OBJDIR)/%.rc: Makefile.Win32 $(OBJDIR)/version.inc @echo BEGIN >> $@ @echo VALUE "LegalCopyright","$(COPYR)\0" >> $@ # @echo VALUE "CompanyName","$(COMPANY)\0" >> $@ - @echo VALUE "ProductName","$(TARGET).$(BINEXT)\0" >> $@ + @echo VALUE "ProductName","$(notdir $(@:.rc=.exe))\0" >> $@ @echo VALUE "ProductVersion","$(RRD_VERSION_STR)\0" >> $@ @echo VALUE "License","Released under GPL.\0" >> $@ @echo VALUE "FileDescription","$(DESCR)\0" >> $@ @echo VALUE "FileVersion","$(RRD_VERSION_STR)\0" >> $@ - @echo VALUE "InternalName","$(TARGET)\0" >> $@ - @echo VALUE "OriginalFilename","$(TARGET).$(BINEXT)\0" >> $@ + @echo VALUE "InternalName","$(notdir $(@:.rc=))\0" >> $@ + @echo VALUE "OriginalFilename","$(notdir $(@:.rc=.exe))\0" >> $@ ifdef WWWURL @echo VALUE "WWW","$(WWWURL)\0" >> $@ endif @@ -350,12 +375,15 @@ endif @echo $(DL)#define RRDGRAPH_YLEGEND_ANGLE $(RRDGRAPH_YLEGEND_ANGLE)$(DL) >> $@ @echo $(DL)#define RRD_DEFAULT_FONT $(RRD_DEFAULT_FONT)$(DL) >> $@ @echo $(DL)#define strftime strftime_$(DL) >> $@ +ifdef WITH_PIECHART + @echo $(DL)#define WITH_PIECHART 1$(DL) >> $@ +endif $(OBJDIR)/readme.txt: Makefile.Win32 @echo Creating $@ @echo $(DL)This is a binary distribution for Win32 platform.$(DL) > $@ - @echo $(DL)MRTG rrdtool version $(RRD_VERSION_STR)$(DL) >> $@ - @echo $(DL)Please download the complete RRD package for$(DL) >> $@ + @echo $(DL)RRDTool version $(RRD_VERSION_STR)$(DL) >> $@ + @echo $(DL)Please download the complete RRDTool package for$(DL) >> $@ @echo $(DL)any further documentation:$(DL) >> $@ @echo $(DL)http://www.rrdtool.org/$(DL) >> $@ -- 2.30.2