blob: 539e71e9b8b4f8718fad6856b6dcebd32c54b215 [file] [log] [blame]
Stefan Reinauer6559f432010-12-17 00:13:54 +00001##
2## Makefile for ectool
3##
4## Copyright (C) 2009 by coresystems GmbH
5## written by Stefan Reinauer <stepan@coresystems.de>
6##
7## This program is free software; you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as published by
9## the Free Software Foundation; version 2 of the License.
10##
11## This program is distributed in the hope that it will be useful,
12## but WITHOUT ANY WARRANTY; without even the implied warranty of
13## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14## GNU General Public License for more details.
15##
16## You should have received a copy of the GNU General Public License
17## along with this program; if not, write to the Free Software
Paul Menzela46a7122013-02-23 18:37:27 +010018## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Stefan Reinauer6559f432010-12-17 00:13:54 +000019##
Stefan Reinauerb5ab3232009-04-22 07:23:00 +000020
Uwe Hermann424638e2009-04-23 22:22:47 +000021CC = gcc
22CFLAGS = -O2 -Wall -W
23PROGRAM = ectool
24INSTALL = /usr/bin/install
25PREFIX = /usr/local
Stefan Reinauerb5ab3232009-04-22 07:23:00 +000026
Raymond Danks51b8f052012-04-27 08:51:02 -060027OS_ARCH = $(shell uname -o)
28ifeq ($(OS_ARCH), Cygwin)
29LDFLAGS = -lioperm
30endif
31
Uwe Hermann424638e2009-04-23 22:22:47 +000032all: $(PROGRAM)
Stefan Reinauerb5ab3232009-04-22 07:23:00 +000033
Uwe Hermann424638e2009-04-23 22:22:47 +000034$(PROGRAM): ec.o ectool.o
Raymond Danks51b8f052012-04-27 08:51:02 -060035 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
Uwe Hermann257ae3f2009-04-22 12:28:14 +000036
Uwe Hermann424638e2009-04-23 22:22:47 +000037install: $(PROGRAM)
38 $(INSTALL) $(PROGRAM) $(PREFIX)/sbin
39
Stefan Reinauerb5ab3232009-04-22 07:23:00 +000040clean:
Uwe Hermann424638e2009-04-23 22:22:47 +000041 rm *.o $(PROGRAM)
Stefan Reinauerb5ab3232009-04-22 07:23:00 +000042
43%.o: %.c
44 $(CC) $(CFLAGS) -c $^ -I. -o $@