#   07/29/2018
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 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 a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#   MA 02110-1301, USA.

CFLAGS+=-Wall -Wextra -O2 -D_POSIX_C_SOURCE=200112L -std=c99 -pipe -pedantic -Wundef -Wshadow -W -Wwrite-strings -Wcast-align -Wstrict-overflow=5 -Wconversion -Wpointer-arith -Wstrict-prototypes -Wformat=2 -Wsign-compare -Wendif-labels -Wredundant-decls -Winit-self
SRCS=yepstat.c print2.c
PROGS=yepstat print2
BIN_DIR=/usr/bin

all: $(PROGS)

%: %.c
	$(CC) $(CFLAGS) -o $@ $<

install: 
	install -D -s -m 755 yepstat $(BIN_DIR)/yepstat
	install -D -s -m 755 print2 $(BIN_DIR)/print2

uninstall:
	rm -f $(BIN_DIR)/yepstat
	rm -f $(BIN_DIR)/print2

clean:
	rm -f yepstat
	rm -f print2

.PHONY: all install clean uninstall
