Refactor code so that other protocols can be added with minimal duplicate code.
This commit is contained in:
parent
21893ff091
commit
1972b32b60
12 changed files with 428 additions and 248 deletions
22
Makefile
22
Makefile
|
@ -1,16 +1,20 @@
|
|||
CC := gcc
|
||||
|
||||
# Enable for debug
|
||||
CFLAGS := -g -ggdb -std=c99 -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wstrict-prototypes -Werror
|
||||
CFLAGS := -g -ggdb -std=c99 -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wstrict-prototypes
|
||||
|
||||
INCLUDES := -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
|
||||
INCLUDES := -I/usr/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/samba-4.0
|
||||
|
||||
siahsd_LIB := -ltalloc -ldbi -lglib-2.0
|
||||
siahsd_OBJ := sia.o siahsd.o
|
||||
siahsd_OBJ := sia.o status.o database.o config.o siahsd.o
|
||||
|
||||
OBJ := $(siahsd_OBJ)
|
||||
secipd_LIB := -ltalloc -ldbi -lglib-2.0 -lndr
|
||||
secipd_OBJ := sia.o status.o database.o config.o ndr_secip.o secipd.o
|
||||
|
||||
binaries := siahsd
|
||||
|
||||
OBJ := $(siahsd_OBJ) $(secipd_OBJ)
|
||||
|
||||
binaries := siahsd secipd
|
||||
|
||||
all: $(binaries)
|
||||
|
||||
|
@ -23,6 +27,10 @@ distclean: clean
|
|||
rm -f tags
|
||||
|
||||
|
||||
secipd: $(secipd_OBJ)
|
||||
@echo Linking $@
|
||||
@$(CC) $(secipd_OBJ) $(secipd_LIB) -o secipd
|
||||
|
||||
siahsd: $(siahsd_OBJ)
|
||||
@echo Linking $@
|
||||
@$(CC) $(siahsd_OBJ) $(siahsd_LIB) -o siahsd
|
||||
|
@ -30,6 +38,10 @@ siahsd: $(siahsd_OBJ)
|
|||
ctags:
|
||||
ctags `find -name \*.[ch]`
|
||||
|
||||
idl:
|
||||
pidl/pidl --ndr-parser=ndr_secip.c secip.idl
|
||||
pidl/pidl --header=secip.h secip.idl
|
||||
|
||||
%.o: %.c
|
||||
@echo Compiling $*.c
|
||||
@$(CC) -c $(CFLAGS) $(INCLUDES) -o $*.o $<
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue