
INSTALL_PREFIX=""
PACKAGE=shaperd-2.2.32
CONFIG_DIR=/etc/shaper
RUNTIME_DIR=/var/shaper
PID_DIR=/var/run
DOC_DIR=/usr/share/doc/
SBIN_DIR=/sbin
SRC_DIR=./src/

MAKE=make
INSTALL=install
SYS_CC=gcc

All: sources

clean:
	$(MAKE) -C $(SRC_DIR) clean-all
	rm -f *~
	
sources:
	$(MAKE) -C $(SRC_DIR) shaperd

install-files:
	$(INSTALL) -o root -g root -d doc $(INSTALL_PREFIX)$(DOC_DIR)$(PACKAGE)
	$(INSTALL) -o root -g root -m 0644 -D doc/shaperd_cbq.html $(INSTALL_PREFIX)$(DOC_DIR)$(PACKAGE)/shaperd_cbq.html
	$(INSTALL) -o root -g root -m 0644 -D doc/shaperd_cbq_en.html $(INSTALL_PREFIX)$(DOC_DIR)$(PACKAGE)/shaperd_cbq_en.html
	$(INSTALL) -o root -g root -m 0755 -D $(SRC_DIR)/shaperd $(INSTALL_PREFIX)$(SBIN_DIR)/shaperd

install-config:
	$(INSTALL) -o root -g root -d $(INSTALL_PREFIX)$(CONFIG_DIR)
	$(INSTALL) -o root -g root -m 0644 -D config/* $(INSTALL_PREFIX)$(CONFIG_DIR)

install: sources install-files
