Allow things to compile (and hopfully work on Linux)

This commit is contained in:
Eirik Alderslyst Nygaard 2010-05-11 13:59:30 +00:00
parent 8ab4673bd5
commit f6b52a4b4b
4 changed files with 25 additions and 15 deletions

View File

@ -1,3 +1,4 @@
SUBDIR= psqldbadm psqluseradm
.include <bsd.subdir.mk>
all:
for dir in ${SUBDIR}; do (cd $$dir; make); done

12
misc.c Normal file
View File

@ -0,0 +1,12 @@
#include <string.h>
char *
strlcpy(char *dest, char *src, size_t n)
{
char *p;
p = strncpy(dest, src, n);
dest[n-1] = '\0';
return p;
}

View File

@ -1,13 +1,11 @@
.PATH: ${.CURDIR} ${.CURDIR}/../psqluseradm/
#.PATH: .:../psqluseradm/
CFLAGS= -I/usr/local/include
LDFLAGS=-L/usr/local/lib -lpq
CFLAGS= -I`pg_config --includedir`
LDFLAGS=-lpq
PROG= psql-dbadm
SRCS= psql-dbadm.c psqladm.c
OBJS= psql-dbadm.o ../psqluseradm/psqladm.o ../misc.o
NO_MAN= true
${PROG}: ${OBJS}
gcc -o ${PROG} ${OBJS} ${LDFLAGS}
WARNS?= 6
.include <bsd.prog.mk>

View File

@ -1,11 +1,10 @@
CFLAGS= -I/usr/local/include
LDFLAGS=-L/usr/local/lib -lpq
CFLAGS= -I`pg_config --includedir`
LDFLAGS=-lpq
PROG= psql-useradm
SRCS= psql-useradm.c psqladm.c
OBJS= psql-useradm.o psqladm.o ../misc.o
NO_MAN= true
${PROG}: ${OBJS}
gcc -o ${PROG} ${OBJS} ${LDFLAGS}
WARNS?= 6
.include <bsd.prog.mk>