# General rules for Makefile(s) subsystem.
# In this file we will put everything that need to be
# shared betweek all the Makefile(s).
# This file must be included at the beginning of every Makefile
#
# Copyright (C) 1999-2002 Riccardo Facchetti <riccardo@master.oasi.gpa.it>

#
# package version
PACKAGE = apcupsd
DISTNAME = @DISTNAME@
DISTVER = @DISTVER@
VERSION = @VERSION@

#
# programs needed by compilation
CP = @CP@
MV = @MV@
ECHO = @ECHO@
RM = @RM@
RMF = $(RM) -rf
LN = @LN@
SED = @SED@
MAKE = @MAKE@
SHELL = @SHELL@
RANLIB = @RANLIB@
AR = @AR@
STRP = @STRP@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
MKINSTALLDIRS = @MKINSTALLDIRS@
CHKCONFIG = /sbin/chkconfig
RST2HTML := @RST2HTML@
RST2PDF := @RST2PDF@

# Files and directories (paths)
prefix = @prefix@
exec_prefix = @exec_prefix@
sysconfdir = @sysconfdir@
cgibin = @CGIBIN@
VPATH = /usr/lib:/usr/local/lib
srcdir = @srcdir@
abstopdir = @ABSSRCDIR@
sbindir = @sbindir@
piddir = @PIDDIR@
mandir=@mandir@
bindir = @bindir@
datadir = @datadir@
HALPOLICYDIR = @HALPOLICYDIR@
DISTDIR = @DISTDIR@
PWRFAILDIR = @PWRFAILDIR@
LOCKDIR = @LOCKDIR@
CROSSTOOLS = @CROSSTOOLS@
DEPKGS = @DEPKGS@

# Compilation macros.
CC = @CC@
CXX = @CXX@ -x c++
OBJC = $(CC) -x objective-c++
NIB = ibtool
LD = @LD@
RES = @WINDRES@
DEFS = @EXTRADEFS@ $(LOCALDEFS)
EXE = @EXEEXT@

# Libraries
APCLIBS = $(topdir)/src/lib/libapc.a $(if $(WIN32),$(topdir)/src/win32/compat/libwin32compat.a)
APCDRVLIBS = @APCDRVLIBS@
DRVLIBS = @PTHREAD_LFLAGS@ @DRVLIBS@
X_LIBS = @X_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@

CPPFLAGS = @CPPFLAGS@ -I$(topdir)/include $(EXTRAINCS)
CFLAGS = $(CPPFLAGS) @CFLAGS@ @PTHREAD_CFLAGS@
CXXFLAGS = $(CPPFLAGS) @CXXFLAGS@ @PTHREAD_CFLAGS@
OBJCFLAGS = $(CPPFLAGS) $(CFLAGS)
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
LIBGD = @GD_LIBS@
GAPCMON_CFLAGS = @GAPCMON_CFLAGS@
GAPCMON_LIBS = @GAPCMON_LIBS@
LIBEXTRAOBJ = @LIBEXTRAOBJ@
RST2HTMLOPTS = --field-name-limit=0 --generator --time --no-footnote-backlinks --record-dependencies=$(df).d
RST2PDFOPTS = --no-footnote-backlinks --real-footnotes
NIBFLAGS = 
BG = @BG@

# Driver and package enable flags
SMARTDRV   := @APCSMART_DRIVER@
DUMBDRV    := @DUMB_DRIVER@
USBDRV     := @USB_DRIVER@
NETDRV     := @NET_DRIVER@
PCNETDRV   := @PCNET_DRIVER@
MODBUSDRV  := @MODBUS_DRIVER@
MODBUSUSB  := @MODBUS_USB_DRIVER@
SNMPLTDRV  := @SNMPLITE_DRIVER@
TESTDRV    := @TEST_DRIVER@
USBTYPE    := @USB_TYPE@
CGIDIR     := @CGI@
USBHIDDIR  := @LIBUSBHID@
GAPCMON    := @GAPCMON@
APCAGENT   := @APCAGENT@
WIN32      := @WIN32@

OBJDIR = .obj
DEPDIR = .deps
df = $(DEPDIR)/$(*F)
DEVNULL := >/dev/null 2>&1
