Implement src/daemon.c to provide a high level method to instantiate a patty server Changes: * Refactor src/server.c, src/route.c, src/if.c methods which accept callsign arguments to use a patty_ax25_addr pointer instead; this has significantly reduced the number of redundant calls to patty_ax25_pton() * Decouple patty_ax25_addr from patty_ax25_if_info types when creating new interfaces with patty_ax25_if_new(); instead, take a separate patty_ax25_addr argument * Split patty_ax25_server_run() into the following methods: - patty_ax25_server_start() - patty_ax25_server_stop() - patty_ax25_server_event_handle() This is intended to allow possible integration into other event loops. * Implement src/daemon.c to allow quick instantiation of a server, interfaces, and routes, and to encapsulate the setting of configuration variables; callsigns and interface names are handled as character strings * Rename examples/server.c to examples/daemon.c; reimplement in terms of the patty_daemon code *
61 lines
1.5 KiB
Makefile
61 lines
1.5 KiB
Makefile
include ../mk/build.mk
|
|
|
|
INCLUDE_PATH = ../include
|
|
HEADER_SUBDIR = patty
|
|
|
|
CC = $(CROSS)cc
|
|
CFLAGS = $(CGFLAGS) -fPIC -Wall -O2 -I$(INCLUDE_PATH)
|
|
LDFLAGS =
|
|
|
|
HEADERS = kiss.h ax25.h client.h ax25/if.h ax25/frame.h \
|
|
ax25/sock.h ax25/route.h ax25/server.h daemon.h list.h \
|
|
hash.h dict.h timer.h print.h
|
|
|
|
OBJS = kiss.o ax25.o client.o if.o frame.o \
|
|
sock.o route.o server.o daemon.o list.o \
|
|
hash.o dict.o timer.o print.o
|
|
|
|
VERSION_MAJOR = 0
|
|
VERSION_MINOR = 0.1
|
|
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
|
|
|
|
LIBNAME = patty
|
|
|
|
HEADERS_BUILD = $(addprefix $(INCLUDE_PATH)/$(HEADER_SUBDIR)/, $(HEADERS))
|
|
|
|
AR = $(CROSS)ar
|
|
RANLIB = $(CROSS)ranlib
|
|
|
|
RM = /bin/rm
|
|
LN = /bin/ln
|
|
RMDIR = /bin/rmdir
|
|
INSTALL = /usr/bin/install
|
|
|
|
all: $(STATIC) $(SONAME_FULL) $(SONAME) $(SONAME_SHORT)
|
|
|
|
$(STATIC): $(OBJS)
|
|
$(AR) rc $(STATIC) $(OBJS)
|
|
$(RANLIB) $(STATIC)
|
|
|
|
$(SONAME_FULL): $(OBJS)
|
|
$(CC) $(LLFLAGS) $(OBJS) $(LDFLAGS) -o $(SONAME_FULL)
|
|
|
|
$(SONAME): $(SONAME_FULL)
|
|
$(LN) -s $< $@
|
|
|
|
$(SONAME_SHORT): $(SONAME_FULL)
|
|
$(LN) -s $< $@
|
|
|
|
$(OBJS): %.o: %.c $(HEADERS_BUILD)
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
install: $(SONAME_FULL) $(STATIC)
|
|
$(INSTALL) -c -m 0644 $(STATIC) $(PREFIX)/lib
|
|
$(INSTALL) -c -m 0755 $(SONAME_FULL) $(PREFIX)/lib
|
|
$(LN) -s -f $(SONAME_FULL) $(PREFIX)/lib/$(SONAME)
|
|
$(LN) -s -f $(SONAME_FULL) $(PREFIX)/lib/$(SONAME_SHORT)
|
|
$(INSTALL) -d -m 0755 $(PREFIX)/include/$(HEADER_SUBDIR)
|
|
$(INSTALL) -c -m 0644 $(HEADERS_BUILD) $(PREFIX)/include/$(HEADER_SUBDIR)
|
|
|
|
clean:
|
|
$(RM) -f $(SONAME_SHORT) $(SONAME) $(SONAME_FULL) $(STATIC) $(OBJS)
|