Debian Codegraph @

Makefile

raw
1 # I2C tools for Linux
2 #
3 # Copyright (C) 2007-2012 Jean Delvare <[email protected]>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9
10 DESTDIR ?=
11 PREFIX ?= /usr/local
12 bindir = $(PREFIX)/bin
13 sbindir = $(PREFIX)/sbin
14 mandir = $(PREFIX)/share/man
15 man3dir = $(mandir)/man3
16 man8dir = $(mandir)/man8
17 incdir = $(PREFIX)/include
18 libdir = $(PREFIX)/lib
19
20 INSTALL := install
21 INSTALL_DATA := $(INSTALL) -m 644
22 INSTALL_DIR := $(INSTALL) -m 755 -d
23 INSTALL_PROGRAM := $(INSTALL) -m 755
24 LN := ln -sf
25 RM := rm -f
26
27 CC ?= gcc
28 AR ?= ar
29 STRIP ?= strip
30
31 CFLAGS ?= -O2
32 # When debugging, use the following instead
33 #CFLAGS := -O -g
34 CFLAGS += -Wall
35 SOCFLAGS := -fpic -D_REENTRANT $(CFLAGS)
36
37 BUILD_DYNAMIC_LIB ?= 1
38 BUILD_STATIC_LIB ?= 1
39 USE_STATIC_LIB ?= 0
40
41 ifeq ($(USE_STATIC_LIB),1)
42 BUILD_STATIC_LIB := 1
43 endif
44
45 ifeq ($(BUILD_DYNAMIC_LIB),0)
46 ifeq ($(BUILD_STATIC_LIB),0)
47 $(error BUILD_DYNAMIC_LIB and BUILD_STATIC_LIB cannot be disabled at the same time)
48 else
49 USE_STATIC_LIB := 1
50 endif
51 endif
52
53 .PHONY: all strip clean install uninstall
54
55 all:
56
57 EXTRA :=
58 #EXTRA += eeprog py-smbus
59 SRCDIRS := include lib eeprom stub tools $(EXTRA)
60 include $(SRCDIRS:%=%/Module.mk)