Files
wiringPi/devLib/Makefile
Deokgyu Yang 3f787a1912 Bring devLib/lcd* back
Signed-off-by: Deokgyu Yang <secugyu@gmail.com>
Change-Id: Ifcc4338c95d185b730e87542a5c053a6906c86cb
2020-03-31 11:35:13 +09:00

122 lines
3.3 KiB
Makefile

#
# Makefile:
# wiringPi device - A "wiring" library for the Raspberry Pi
#
# Copyright (c) 2012-2016 Gordon Henderson
#################################################################################
# This file is part of wiringPi:
# https://projects.drogon.net/raspberry-pi/wiringpi/
#
# wiringPi is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wiringPi 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
#################################################################################
VERSION=$(shell cat ../VERSION)
DESTDIR?=/usr
PREFIX?=/local
MAJOR=$(shell cat ../VERSION | cut -d'.' -f1)
LDCONFIG?=ldconfig
ifneq ($V,1)
Q ?= @
endif
STATIC=libwiringPiDev.a
DYNAMIC=libwiringPiDev.so.$(VERSION)
#DEBUG = -g -O0
DEBUG = -O2
CC = gcc
INCLUDE = -I. -I../wiringPi
DEFS = -D_GNU_SOURCE
CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
LIBS =
###############################################################################
SRC = lcd128x64.c lcd.c
OBJ = $(SRC:.c=.o)
HEADERS = lcd128x64.h lcd.h
all: $(DYNAMIC)
static: $(STATIC)
$(STATIC): $(OBJ)
$Q echo "[Link (Static)]"
$Q ar rcs $(STATIC) $(OBJ)
$Q ranlib $(STATIC)
# @size $(STATIC)
$(DYNAMIC): $(OBJ)
$Q echo "[Link (Dynamic)]"
$Q $(CC) -shared -Wl,-soname,libwiringPiDev.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
.c.o:
$Q echo [Compile] $<
$Q $(CC) -c $(CFLAGS) $< -o $@
.PHONY: clean
clean:
$Q echo "[Clean]"
$Q rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
.PHONY: tags
tags: $(SRC)
$Q echo [ctags]
$Q ctags $(SRC)
.PHONY: install
install: $(DYNAMIC)
$Q echo "[Install Headers]"
$Q install -m 0755 -d $(DESTDIR)$(PREFIX)/include
$Q install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
$Q echo "[Install Dynamic Lib]"
$Q install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
$Q install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
$Q ln -sf libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so.$(MAJOR)
$Q ln -sf libwiringPiDev.so.$(MAJOR) $(DESTDIR)/lib/libwiringPiDev.so
$Q $(LDCONFIG)
.PHONY: install-static
install-static: $(STATIC)
$Q echo "[Install Headers]"
$Q install -m 0755 -d $(DESTDIR)$(PREFIX)/include
$Q install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
$Q echo "[Install Static Lib]"
$Q install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
$Q install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib
.PHONY: uninstall
uninstall:
$Q echo "[UnInstall]"
$Q cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
$Q cd $(DESTDIR)$(PREFIX)/lib/ && rm -f libwiringPiDev.*
$Q $(LDCONFIG)
.PHONY: depend
depend:
makedepend -Y $(SRC)
# DO NOT DELETE
lcd128x64.o: font.h lcd128x64.h
lcd.o: lcd.h