# Test stubs Makefile # # This file is part of the Pollcat Library. # Copyright (C) 2022,2025 Expatria Technologies Inc. # Contact: Morgan Hughes # # 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 # Integrators should override these PREFIX ?= /usr/local export PREFIX DESTDIR # 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: mkdir -p $(DESTDIR)$(PREFIX)/bin install -m755 $(BINS) $(DESTDIR)$(PREFIX)/bin 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 $@