summaryrefslogtreecommitdiff
path: root/commandline/Makefile
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-07-28 19:17:18 +0200
committerDaniel Friesel <derf@finalrewind.org>2013-07-28 19:17:18 +0200
commitc3521ef27bb1fd049f87b1bb0da158842565e8c6 (patch)
treea56109ae420c2e7bd46120a9deddf4f9970bbb53 /commandline/Makefile
parent6011c99aca409a4d78c773cbdbe24e09d3286b96 (diff)
move common code to i2c-util.c
Diffstat (limited to 'commandline/Makefile')
-rw-r--r--commandline/Makefile53
1 files changed, 16 insertions, 37 deletions
diff --git a/commandline/Makefile b/commandline/Makefile
index 1f33ff0..3870114 100644
--- a/commandline/Makefile
+++ b/commandline/Makefile
@@ -1,59 +1,38 @@
-# Name: Makefile
-# Project: PowerSwitch
-# Author: Christian Starkjohann
-# Creation Date: 2005-01-16
-# Tabsize: 4
-# Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
-# License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
-# This Revision: $Id$
-
-
-# Concigure the following definitions according to your system. The powerSwitch
-# tool has been successfully compiled on Mac OS X, Linux and Windows.
-
# Use the following 3 lines on Unix (uncomment the framework on Mac OS X):
USBFLAGS = `libusb-config --cflags`
USBLIBS = `libusb-config --libs` #-framework CoreFoundation
-EXE_SUFFIX =
-# Use the following 3 lines on Windows and comment out the 3 above. You may
-# have to change the include paths to where you installed libusb-win32
-#USBFLAGS = -I/usr/local/include
-#USBLIBS = -L/usr/local/lib -lusb
-#EXE_SUFFIX = .exe
-
-
-CC = gcc
-CFLAGS = $(USBFLAGS) -O -Wall
-LIBS = $(USBLIBS)
+CC ?= gcc
+CFLAGS = $(USBFLAGS) -O2 -Wall -Wextra -pedantic
+LIBS = $(USBLIBS)
PREFIX ?= /usr/local
bin_dir = ${DESTDIR}${PREFIX}/bin
-PROGRAM = vusb-i2c$(EXE_SUFFIX)
-
+PROGRAMS = vusb-i2c
-all: $(PROGRAM) vusb-i2cdetect
+all: $(PROGRAMS)
.c.o:
$(CC) $(CFLAGS) -c $<
-$(PROGRAM): i2c.o
- $(CC) -o $(PROGRAM) i2c.o $(LIBS)
+i2c.o: i2c.c i2c-util.c i2c-util.h
+i2c-util.o: i2c-util.c
+i2cdetect.o: i2cdetect.c
-vusb-i2cdetect: i2cdetect.o
- $(CC) -o vusb-i2cdetect i2cdetect.o $(LIBS)
+vusb-i2c: i2c.o i2c-util.o
+ $(CC) -o $@ $^ $(LIBS)
-strip: $(PROGRAM)
- strip $(PROGRAM)
+vusb-i2cdetect: i2cdetect.o i2c-util.o
+ $(CC) -o $@ $^ $(LIBS)
clean:
- rm -f *.o $(PROGRAM)
+ rm -f *.o $(PROGRAMS)
-install: $(PROGRAM)
- install -m 0755 $(PROGRAM) $(bin_dir)/$(PROGRAM)
+install:
+ install -m 0755 $(PROGRAMS) $(bin_dir)
uninstall:
- rm -f $(bin_dir)/$(PROGRAM)
+ rm -rf $(bin_dir)/vusb-i2c $(bin_dir)/vusb-i2cdetect
.PHONY: all strip clean install uninstall