2010-12-17 01:13:54 +01:00
|
|
|
## 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; version 2 of the License.
|
|
|
|
##
|
|
|
|
## 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.
|
|
|
|
##
|
2009-04-22 09:23:00 +02:00
|
|
|
|
2009-04-24 00:22:47 +02:00
|
|
|
CC = gcc
|
2019-07-19 20:27:27 +02:00
|
|
|
CFLAGS = -O2 -Wall -Wextra
|
2009-04-24 00:22:47 +02:00
|
|
|
PROGRAM = ectool
|
2018-10-07 03:58:27 +02:00
|
|
|
INSTALL = /usr/bin/env install
|
2009-04-24 00:22:47 +02:00
|
|
|
PREFIX = /usr/local
|
2016-01-05 12:27:59 +01:00
|
|
|
OS_ARCH = $(shell uname)
|
2009-04-22 09:23:00 +02:00
|
|
|
|
2016-01-05 12:27:59 +01:00
|
|
|
ifeq ($(shell uname -o 2>/dev/null), Cygwin)
|
2012-04-27 16:51:02 +02:00
|
|
|
LDFLAGS = -lioperm
|
|
|
|
endif
|
|
|
|
|
2017-01-29 20:52:56 +01:00
|
|
|
ifeq ($(OS_ARCH), $(filter $(OS_ARCH), NetBSD OpenBSD))
|
2016-01-05 12:27:59 +01:00
|
|
|
LDFLAGS = -l$(shell uname -p)
|
|
|
|
endif
|
|
|
|
|
2009-04-24 00:22:47 +02:00
|
|
|
all: $(PROGRAM)
|
2009-04-22 09:23:00 +02:00
|
|
|
|
2009-04-24 00:22:47 +02:00
|
|
|
$(PROGRAM): ec.o ectool.o
|
2012-04-27 16:51:02 +02:00
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
2009-04-22 14:28:14 +02:00
|
|
|
|
2009-04-24 00:22:47 +02:00
|
|
|
install: $(PROGRAM)
|
|
|
|
$(INSTALL) $(PROGRAM) $(PREFIX)/sbin
|
|
|
|
|
2009-04-22 09:23:00 +02:00
|
|
|
clean:
|
2015-10-21 22:50:00 +02:00
|
|
|
rm -f *.o $(PROGRAM) junit.xml
|
|
|
|
|
|
|
|
distclean: clean
|
2009-04-22 09:23:00 +02:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c $^ -I. -o $@
|
2015-10-21 22:50:00 +02:00
|
|
|
|
|
|
|
.PHONY: all install clean distclean
|