patty/src/Makefile
XANTRONIX Development e10ce6b8e1 Implement generic timer functions in src/timer.c
Changes:

    * Implement patty_timer_expired() to determine if a timer has
      expired or has gone negative

    * Implement patty_timer_cancel() to set a timer to zero

    * Implement patty_timer_start() to initialize a timer, add a
      specified number of milliseconds, and ensure a target timer (such
      as the server timer) is set for at least that value as well

    * Implement patty_timer_tick() to subtract an elapsed time value
      from a timer

    * Remove functions specific to each timer in src/sock.c, as those
      can now be handled generically by src/timer.c

    * Replace calls to patty_ax25_sock_timer_t1_*() with patty_timer_*()
      calls instead; reference the struct timeval objects directly
      within the sock (for the time being, pending opaque structures)
2024-03-01 00:20:46 -05:00

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 ax25/if.h ax25/call.h ax25/frame.h ax25/sock.h \
ax25/route.h ax25/server.h list.h hash.h dict.h timer.h \
print.h
OBJS = kiss.o ax25.o if.o call.o frame.o sock.o \
route.o server.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)