1 # Gnu Makefile for NetWare target
2 # for use with gcc/nlmconv or Metrowerks CodeWarrior compiler
3 # use with: make -f Makefile [help|all|clean|dev|devclean|dist|distclean]
8 DESCR = Round Robin Database Tool $(RRD_VERSION_STR)
9 COPYR = Copyright (c) 1997-2007 by Tobias Oetiker
10 WWWURL = http://www.rrdtool.org/
14 # Comment the line below if you dont want to load protected automatically.
17 # You can set the default font used in graphs.
18 # If not set here RRD defaults to DejaVuSansMono-Roman.ttf
19 #RRD_DEFAULT_FONT = "sys:/java/nwgfx/lib/x11/fonts/ttf/tt0003m_.ttf"
20 #RRD_DEFAULT_FONT = "VeraMono.ttf"
22 # Vertical label angle: 90.0 (default) or 270.0
23 RRDGRAPH_YLEGEND_ANGLE = 90.0
25 # Set to one if you want to have piecharts.
28 # Set the extension used for rrdcgi.
33 # Edit the path below to point to your Novell NDK.
38 # Base for the lib sources
42 # All library code is statically linked to avoid problems with other lib NLMs.
43 # Edit the path below to point to your libpng sources or set environment var.
45 LIBPNG = $(LIBBASE)/libpng-1.2.16
47 # Edit the path below to point to your freetype sources or set environment var.
49 LIBFT2 = $(LIBBASE)/freetype-2.3.4
51 # Edit the path below to point to your libart sources or set environment var.
53 LIBART = $(LIBBASE)/libart_lgpl-2.3.17
55 # Edit the path below to point to your zlib sources or set environment var.
57 ZLIBSDK = $(LIBBASE)/zlib-1.2.3
60 # Edit the path below to point to your distribution folder.
62 DISTDIR = rrdtool-$(RRD_VERSION_STR)-nw
64 DISTARC = $(DISTDIR).zip
66 # Edit the path below to point to your distribution folder.
68 DEVLDIR = rrdtool-$(RRD_VERSION_STR)-sdk-nw
70 DEVLARC = $(DEVLDIR).zip
75 # Edit the var below to point to your lib architecture.
81 # The following line defines your compiler.
89 # if you want to mark the target as MTSAFE you will need a tool for
90 # generating the xdc data for the linker; here's a minimal tool:
91 # http://www.gknw.net/development/prgtools/mkxdc.zip
93 # CodeWarrior is too stupid to set the internal name properly when
94 # the extension is not a NLM and not a registered type. So we need
95 # to fix that after linking (since CGI isnt a known type - argh!):
96 # http://www.gknw.net/development/prgtools/fixnlmname.zip
97 FIXNLMN = fixnlmname #-q
98 # Here you can find a native Win32 binary of the original awk:
99 # http://www.gknw.net/development/prgtools/awk.zip
104 # must be equal to DEBUG or NDEBUG
107 # Optimization: -O<n> or debugging: -g
119 # Include the version info retrieved from source.
120 -include $(OBJDIR)/version.inc
122 # Global flags for all compilers
123 CFLAGS = $(OPT) -D$(DB) -nostdinc -DNETWARE -DN_PLAT_NLM -D_POSIX_SOURCE
124 CFLAGS += -DHAVE_CONFIG_H
128 LDFLAGS = -nostdlib $^ $(PRELUDE) $(LDLIBS) -o $@ -commandfile
130 ARFLAGS = -nostdlib -type library -o
133 CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
134 CFLAGS += -relax_pointers
135 #CFLAGS += -w on,nounused,nounusedexpr # -ansi strict
136 ifeq ($(LIBARCH),LIBC)
137 PRELUDE = $(SDK_LIBC)/imports/libcpre.o
140 PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
141 CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
151 CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing
152 CFLAGS += -Wall -Wno-unused # -pedantic
153 ifeq ($(LIBARCH),LIBC)
154 PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
156 PRELUDE = $(NDK_ROOT)/pre/prelude.o
157 CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
161 ifeq ($(findstring linux,$(OSTYPE)),linux)
162 #include $(NDKBASE)/nlmconv/ncpfs.inc
176 DESCR = $(notdir $(@:.def=)) Command Extension
178 DESCR += ($(LIBARCH)) - $(CC) build
180 NDK_ROOT = $(NDKBASE)/ndk
181 SDK_CLIB = $(NDK_ROOT)/nwsdk
182 SDK_LIBC = $(NDK_ROOT)/libc
184 INCLUDES += -I$(PROOT) -I$(PROOT)/src -I$(LIBPNG) -I$(LIBFT2)/include -I$(LIBART) -I$(ZLIBSDK)
186 ifeq ($(LIBARCH),LIBC)
187 INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
189 INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
192 CFLAGS += $(INCLUDES)
194 vpath %.c $(PROOT)/src $(LIBPNG) $(LIBART)/libart_lgpl $(ZLIBSDK)
197 $(OBJDIR)/rrd_afm.o \
198 $(OBJDIR)/rrd_afm_data.o \
199 $(OBJDIR)/rrd_create.o \
200 $(OBJDIR)/rrd_diff.o \
201 $(OBJDIR)/rrd_dump.o \
202 $(OBJDIR)/rrd_error.o \
203 $(OBJDIR)/rrd_fetch.o \
204 $(OBJDIR)/rrd_first.o \
205 $(OBJDIR)/rrd_format.o \
206 $(OBJDIR)/rrd_gfx.o \
207 $(OBJDIR)/rrd_graph.o \
208 $(OBJDIR)/rrd_graph_helper.o \
210 $(OBJDIR)/rrd_info.o \
211 $(OBJDIR)/rrd_last.o \
212 $(OBJDIR)/rrd_lastupdate.o \
213 $(OBJDIR)/rrd_nan_inf.o \
214 $(OBJDIR)/rrd_open.o \
215 $(OBJDIR)/rrd_resize.o \
216 $(OBJDIR)/rrd_restore.o \
217 $(OBJDIR)/rrd_rpncalc.o \
218 $(OBJDIR)/rrd_tune.o \
219 $(OBJDIR)/rrd_update.o \
220 $(OBJDIR)/rrd_version.o \
221 $(OBJDIR)/rrd_xport.o \
222 $(OBJDIR)/rrd_thread_safe.o \
226 $(OBJDIR)/rrd_getopt.o \
227 $(OBJDIR)/rrd_getopt1.o \
228 $(OBJDIR)/art_rgba_svp.o \
229 $(OBJDIR)/hash_32.o \
230 $(OBJDIR)/parsetime.o \
231 $(OBJDIR)/pngsize.o \
236 $(OBJDIR)/pngerror.o \
239 $(OBJDIR)/pngpread.o \
240 $(OBJDIR)/pngread.o \
242 $(OBJDIR)/pngrtran.o \
243 $(OBJDIR)/pngrutil.o \
245 $(OBJDIR)/pngtrans.o \
247 $(OBJDIR)/pngwrite.o \
248 $(OBJDIR)/pngwtran.o \
249 $(OBJDIR)/pngwutil.o \
251 ifeq "$(wildcard $(LIBPNG)/pnggccrd.c)" "$(LIBPNG)/pnggccrd.c"
253 $(OBJDIR)/pnggccrd.o \
254 $(OBJDIR)/pngvcrd.o \
259 $(OBJDIR)/adler32.o \
260 $(OBJDIR)/compress.o \
262 $(OBJDIR)/deflate.o \
263 $(OBJDIR)/inflate.o \
264 $(OBJDIR)/inffast.o \
265 $(OBJDIR)/inftrees.o \
269 ifeq "$(wildcard $(ZLIBSDK)/infblock.c)" "$(ZLIBSDK)/infblock.c"
271 $(OBJDIR)/infblock.o \
272 $(OBJDIR)/infcodes.o \
273 $(OBJDIR)/infutil.o \
278 $(patsubst $(LIBART)/libart_lgpl/%.c,$(OBJDIR)/%.o,$(wildcard $(LIBART)/libart_lgpl/art_*.c))
280 OBJS := $(RRDLIBOBJS) $(XLIBOBJS) $(PNGLIBOBJS) $(ARTLIBOBJS) $(ZLIBOBJS)
281 OBJCGI := $(OBJS) $(OBJDIR)/rrd_cgi.o
282 OBJTOOL := $(OBJS) $(OBJDIR)/rrd_tool.o
284 LDLIBS += $(LIBFT2)/builds/netware/libc/libft2.$(LIBEXT)
289 rrdtool: $(OBJDIR) $(PROOT)/rrd_config.h $(OBJDIR)/rrdtool.nlm
290 rrdcgi: $(OBJDIR) $(PROOT)/rrd_config.h $(OBJDIR)/rrdcgi.$(CGIEXT)
291 librrd: $(OBJDIR) $(PROOT)/rrd_config.h $(OBJDIR)/librrd.$(LIBEXT)
295 dist: all $(DISTDIR) $(DISTDIR)/readme.txt
296 @-$(CP) $(OBJDIR)/rrdcgi.$(CGIEXT) $(DISTDIR)
297 @-$(CP) $(OBJDIR)/rrdtool.nlm $(DISTDIR)
298 @-$(CP) $(PROOT)/src/*.ttf $(DISTDIR)
299 @-$(CP) $(PROOT)/CHANGES $(DISTDIR)
300 @-$(CP) $(PROOT)/COPYING $(DISTDIR)
301 @-$(CP) $(PROOT)/COPYRIGHT $(DISTDIR)
302 @-$(CP) $(PROOT)/NEWS $(DISTDIR)
303 @-$(CP) $(PROOT)/README $(DISTDIR)
304 @echo Creating $(DISTARC)
305 @$(ZIP) $(DISTARC) $(DISTDIR)/* < $(DISTDIR)/readme.txt
307 dev: librrd $(DEVLDIR) $(DEVLDIR)/readme.txt
308 @-mkdir $(DEVLDIR)$(DS)include
309 @-mkdir $(DEVLDIR)$(DS)lib
310 @-mkdir $(DEVLDIR)$(DS)src
311 @-$(CP) $(OBJDIR)/librrd.$(LIBEXT) $(DEVLDIR)/lib
312 @-$(CP) $(PROOT)/rrd_config.h $(DEVLDIR)/include
313 @-$(CP) $(PROOT)/src/rrd.h $(DEVLDIR)/include
314 @-$(CP) $(PROOT)/src/*.ttf $(DEVLDIR)/src
315 @-$(CP) $(PROOT)/CHANGES $(DEVLDIR)
316 @-$(CP) $(PROOT)/COPYING $(DEVLDIR)
317 @-$(CP) $(PROOT)/COPYRIGHT $(DEVLDIR)
318 @-$(CP) $(PROOT)/NEWS $(DEVLDIR)
319 @-$(CP) $(PROOT)/README $(DEVLDIR)
320 @echo Creating $(DEVLARC)
321 @$(ZIP) $(DEVLARC) $(DEVLDIR)/* < $(DEVLDIR)/readme.txt
325 -$(RM) $(PROOT)/rrd_config.h
344 $(OBJDIR)/version.inc: $(PROOT)/configure.ac $(OBJDIR) $(PROOT)/src/get_ver.awk
346 @$(AWK) -f $(PROOT)/src/get_ver.awk $< > $@
350 @$(CC) $(CFLAGS) -c $< -o $@
352 $(OBJDIR)/rrdcgi.$(CGIEXT): $(OBJCGI) $(OBJDIR)/rrdcgi.def $(OBJDIR)/rrdcgi.xdc
355 @$(LD) $(LDFLAGS) $(@:.$(CGIEXT)=.def)
357 @$(MV) $(notdir $@) $@
359 ifneq ($(CGIEXT),nlm)
365 $(OBJDIR)/rrdtool.nlm: $(OBJTOOL) $(OBJDIR)/rrdtool.def $(OBJDIR)/rrdtool.xdc
368 @$(LD) $(LDFLAGS) $(@:.nlm=.def)
370 @$(MV) $(notdir $@) $@
373 $(OBJDIR)/librrd.$(LIBEXT): $(OBJS)
376 @$(AR) $(ARFLAGS) $@ $^
381 $(OBJDIR)/%.xdc: Makefile
383 @$(MPKXDC) $(XDCOPT) $@
385 $(OBJDIR)/%.def: Makefile $(OBJDIR)/version.inc
386 @echo $(DL)# DEF Linker File for use with gcc and nlmconv$(DL) > $@
387 @echo $(DL)# or with Codewarrior command line compiler.$(DL) >> $@
388 @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
389 @echo $(DL)# All your changes will be lost!!$(DL) >> $@
390 @echo $(DL)#$(DL) >> $@
391 @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
392 @echo $(DL)description "$(DESCR)"$(DL) >> $@
393 @echo $(DL)version $(RRD_VERSION)$(DL) >> $@
395 @echo $(DL)type $(NLMTYPE)$(DL) >> $@
397 @echo $(DL)type 0$(DL) >> $@
400 @echo $(DL)stack $(STACK)$(DL) >> $@
402 @echo $(DL)threadname "$(notdir $(@:.def=))"$(DL) >> $@
404 @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
406 @echo $(DL)screenname "DEFAULT"$(DL) >> $@
409 @echo $(DL)debug$(DL) >> $@
411 ifeq ($(LIBARCH),CLIB)
412 @echo $(DL)start _Prelude$(DL) >> $@
413 @echo $(DL)exit _Stop$(DL) >> $@
414 @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/clib.imp$(DL) >> $@
415 @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/threads.imp$(DL) >> $@
416 @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/nlmlib.imp$(DL) >> $@
417 @echo $(DL)module clib$(DL) >> $@
419 @echo $(DL)start _LibCPrelude$(DL) >> $@
420 @echo $(DL)exit _LibCPostlude$(DL) >> $@
421 @echo $(DL)check _LibCCheckUnload$(DL) >> $@
422 @echo $(DL)import @$(NDK_ROOT)/libc/imports/libc.imp$(DL) >> $@
423 @echo $(DL)import @$(NDK_ROOT)/libc/imports/netware.imp$(DL) >> $@
424 @echo $(DL)module libc$(DL) >> $@
425 @echo $(DL)pseudopreemption$(DL) >> $@
426 @echo $(DL)flag_on 64$(DL) >> $@
429 @echo $(DL)flag_on 16$(DL) >> $@
432 @echo $(DL)flag_on 512$(DL) >> $@
435 @echo $(DL)xdcdata $(@:.def=.xdc)$(DL) >> $@
438 @echo $(DL)input $(OBJS) $(LDLIBS)$(DL) >> $@
439 @echo $(DL)input $(PRELUDE)$(DL) >> $@
440 @echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
443 $(PROOT)/rrd_config.h: FORCE Makefile $(OBJDIR)/version.inc
445 @echo $(DL)/* $(notdir $@) for NetWare target.$(DL) > $@
446 @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
447 @echo $(DL)** All your changes will be lost!!$(DL) >> $@
448 @echo $(DL)*/$(DL) >> $@
449 @echo $(DL)#ifndef NETWARE$(DL) >> $@
450 @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
451 @echo $(DL)#endif$(DL) >> $@
452 @echo $(DL)#ifndef RRD_CONFIG_H$(DL) >> $@
453 @echo $(DL)#define RRD_CONFIG_H$(DL) >> $@
454 @echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
455 @echo $(DL)#define PACKAGE_VERSION "$(RRD_VERSION_STR)"$(DL) >> $@
456 @echo $(DL)#define PACKAGE_BUGREPORT "tobi@oetiker.ch"$(DL) >> $@
457 @echo $(DL)#define NUMVERS $(RRD_NUMVERS)$(DL) >> $@
458 @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
459 @echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
460 @echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
461 @echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
462 @echo $(DL)#define HAVE_ERRNO_H 1$(DL) >> $@
463 @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
464 @echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
465 @echo $(DL)#define HAVE_FLOAT_H 1$(DL) >> $@
466 @echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
467 @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
468 @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
469 @echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
470 @echo $(DL)#define HAVE_LOCALE_H 1$(DL) >> $@
471 @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
472 @echo $(DL)#define HAVE_MATH_H 1$(DL) >> $@
473 @echo $(DL)#define HAVE_MBSTOWCS 1$(DL) >> $@
474 @echo $(DL)#define HAVE_MEMMOVE 1$(DL) >> $@
475 @echo $(DL)#define HAVE_MKTIME 1$(DL) >> $@
476 @echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
477 @echo $(DL)#define HAVE_SETLOCALE 1$(DL) >> $@
478 @echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
479 @echo $(DL)#define HAVE_SNPRINTF 1$(DL) >> $@
480 @echo $(DL)#define HAVE_STDARG_H 1$(DL) >> $@
481 @echo $(DL)#define HAVE_STDDEF_H 1$(DL) >> $@
482 @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
483 @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
484 @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
485 @echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
486 @echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
487 @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
488 @echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
489 @echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
490 @echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
491 @echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
492 @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
493 @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
494 @echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
495 @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
496 @echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
497 @echo $(DL)#define HAVE_TZSET 1$(DL) >> $@
498 @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
499 @echo $(DL)#define HAVE_VSNPRINTF 1$(DL) >> $@
500 @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
501 @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
502 @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@
503 @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@
504 ifdef NO_NULL_REALLOC
505 @echo $(DL)#define NO_NULL_REALLOC 1$(DL) >> $@
506 @echo $(DL)#define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) ))$(DL) >> $@
508 @echo $(DL)#define rrd_realloc(a,b) realloc((a), (b))$(DL) >> $@
510 ifdef RRD_DEFAULT_FONT
511 @echo $(DL)#define RRD_DEFAULT_FONT $(RRD_DEFAULT_FONT)$(DL) >> $@
513 @echo $(DL)#define RRDGRAPH_YLEGEND_ANGLE $(RRDGRAPH_YLEGEND_ANGLE)$(DL) >> $@
515 @echo $(DL)#define WITH_PIECHART $(WITH_PIECHART)$(DL) >> $@
517 @echo $(DL)#endif /* RRD_CONFIG_H */$(DL) >> $@
519 $(DISTDIR)/readme.txt: Makefile
521 @echo $(DL)This is a binary distribution for NetWare platform.$(DL) > $@
522 @echo $(DL)RRDTool version $(RRD_VERSION_STR)$(DL) >> $@
523 @echo $(DL)Please download the complete RRDTool package for$(DL) >> $@
524 @echo $(DL)any further documentation:$(DL) >> $@
525 @echo $(DL)$(WWWURL)$(DL) >> $@
527 $(DEVLDIR)/readme.txt: Makefile
529 @echo $(DL)This is a development distribution for NetWare platform.$(DL) > $@
530 @echo $(DL)RRDTool version $(RRD_VERSION_STR)$(DL) >> $@
531 @echo $(DL)Please download the complete RRDTool package for$(DL) >> $@
532 @echo $(DL)any further documentation:$(DL) >> $@
533 @echo $(DL)$(WWWURL)$(DL) >> $@
536 @echo $(DL)===========================================================$(DL)
537 @echo $(DL)Novell NDK Base = $(NDKBASE)$(DL)
538 @echo $(DL)libpng Source = $(LIBPNG)$(DL)
539 @echo $(DL)libart Source = $(LIBART)$(DL)
540 @echo $(DL)Freetype 2 SDK = $(LIBFT2)$(DL)
541 @echo $(DL)Zlib SDK = $(ZLIBSDK)$(DL)
542 @echo $(DL)===========================================================$(DL)
543 @echo $(DL)RRDTool $(RRD_VERSION_STR) - available targets are:$(DL)
544 @echo $(DL)$(MAKE) all$(DL)
545 @echo $(DL)$(MAKE) rrdtool$(DL)
546 @echo $(DL)$(MAKE) rrdcgi$(DL)
547 @echo $(DL)$(MAKE) librrd$(DL)
548 @echo $(DL)$(MAKE) clean$(DL)
549 @echo $(DL)$(MAKE) dev$(DL)
550 @echo $(DL)$(MAKE) devclean$(DL)
551 @echo $(DL)$(MAKE) dist$(DL)
552 @echo $(DL)$(MAKE) distclean$(DL)
553 @echo $(DL)===========================================================$(DL)