Initial commit of Pollcat library

This commit is contained in:
2022-06-28 15:25:57 -07:00
commit bbd4625d43
26 changed files with 3534 additions and 0 deletions

73
tests/Makefile Normal file
View File

@@ -0,0 +1,73 @@
# Test stubs Makefile
#
# This file is part of the Pollcat Library.
# Copyright (C) 2022 Expatria Technologies Inc.
# Contact: Morgan Hughes <morgan@expatria.ca>
#
# The Pollcat Library is free software: you can redistribute it and/or modify it under the
# terms of the the GNU Lesser General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received copies of the GNU General Public License and the GNU Lesser
# General Public License along with the Pollcat Library. If not, see
# https://www.gnu.org/licenses/
#
# vim:ts=4:noexpandtab
# output targets
BINS := \
poll \
struct \
timer
# "poll" app
POLL_OBJS := poll.o
POLL_LIBS := -lpollcat
# "struct" app
STRUCT_OBJS := struct.o
STRUCT_LIBS := -lpollcat
# "timer app
TIMER_OBJS := timer.o
TIMER_LIBS := -lpollcat
CFLAGS += -I../include -Wall -Werror -g
CFLAGS += -D_LARGEFILE64_SOURCE
LFLAGS += -L.. -Wl,-rpath=$(shell cd .. && pwd)
.PHONY: all install clean
all: $(BINS)
@echo
poll: $(POLL_OBJS)
$(CC) $(CFLAGS) $(LFLAGS) $^ $(POLL_LIBS) -o $@
struct: $(STRUCT_OBJS)
$(CC) $(CFLAGS) $(LFLAGS) $^ $(STRUCT_LIBS) -o $@
timer: $(TIMER_OBJS)
$(CC) $(CFLAGS) $(LFLAGS) $^ $(TIMER_LIBS) -o $@
install:
false
clean:
rm -f $(POLL_OBJS)
rm -f $(STRUCT_OBJS)
rm -f $(TIMER_OBJS)
rm -f $(BINS)
%.i: %.c
$(CC) $(CFLAGS) -E $< -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@