Update Makefile and fix compilation errors
This commit is contained in:
parent
5208248f25
commit
4bebf388a5
34
Makefile
34
Makefile
@ -1,11 +1,17 @@
|
|||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
MFLAGS = DEBUG=${DEBUG}
|
CXXFLAGS ?= -g -DDEBUG
|
||||||
else
|
else
|
||||||
MFLAGS =
|
CXXFLAGS ?= -O3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
MANDIR = ${DESTDIR}/usr/share/man
|
PREFIX ?= /usr/local
|
||||||
SBINDIR = ${DESTDIR}/usr/sbin
|
CXX ?= g++
|
||||||
|
LDFLAGS ?= -lconfuse
|
||||||
|
OBJ ?= src/log.o src/ndppd.o src/iface.o src/proxy.o src/address.o \
|
||||||
|
src/rule.o src/session.o src/conf.o
|
||||||
|
GZIP ?= /bin/gzip
|
||||||
|
MANDIR ?= ${DESTDIR}${PREFIX}/share/man
|
||||||
|
SBINDIR ?= ${DESTDIR}${PREFIX}/sbin
|
||||||
|
|
||||||
all: ndppd ndppd.1.gz ndppd.conf.5.gz
|
all: ndppd ndppd.1.gz ndppd.conf.5.gz
|
||||||
|
|
||||||
@ -16,15 +22,17 @@ install: all
|
|||||||
cp ndppd.1.gz ${MANDIR}/man1
|
cp ndppd.1.gz ${MANDIR}/man1
|
||||||
cp ndppd.conf.5.gz ${MANDIR}/man5
|
cp ndppd.conf.5.gz ${MANDIR}/man5
|
||||||
|
|
||||||
ndppd:
|
|
||||||
cd src && make ${MFLAGS} all && cp ndppd ..
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f ndppd ndppd.conf.5.gz ndppd.1.gz
|
|
||||||
cd src && make clean
|
|
||||||
|
|
||||||
ndppd.1.gz:
|
ndppd.1.gz:
|
||||||
gzip < ndppd.1 > ndppd.1.gz
|
${GZIP} < ndppd.1 > ndppd.1.gz
|
||||||
|
|
||||||
ndppd.conf.5.gz:
|
ndppd.conf.5.gz:
|
||||||
gzip < ndppd.conf.5 > ndppd.conf.5.gz
|
${GZIP} < ndppd.conf.5 > ndppd.conf.5.gz
|
||||||
|
|
||||||
|
ndppd: ${OBJ}
|
||||||
|
${CXX} -o ndppd ${LDFLAGS} ${OBJ}
|
||||||
|
|
||||||
|
.cc.o:
|
||||||
|
${CXX} -c $(CXXFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f ndppd ndppd.conf.5.gz ndppd.1.gz ${OBJ}
|
||||||
|
23
src/Makefile
23
src/Makefile
@ -1,23 +0,0 @@
|
|||||||
ifdef DEBUG
|
|
||||||
CFLAGS = -g -DDEBUG
|
|
||||||
else
|
|
||||||
CFLAGS = -O3
|
|
||||||
endif
|
|
||||||
|
|
||||||
CC = g++
|
|
||||||
LDFLAGS = -lconfuse
|
|
||||||
OBJ = log.o ndppd.o iface.o proxy.o address.o rule.o session.o conf.o
|
|
||||||
|
|
||||||
|
|
||||||
all: ndppd
|
|
||||||
|
|
||||||
ndppd: ${OBJ}
|
|
||||||
${CC} -o ndppd ${LDFLAGS} ${OBJ}
|
|
||||||
|
|
||||||
.cc.o:
|
|
||||||
${CC} -c $(CFLAGS) $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f ndppd ${OBJ}
|
|
||||||
|
|
||||||
|
|
@ -13,9 +13,10 @@
|
|||||||
//
|
//
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <stdlib.h>
|
#include <cstdlib>
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user