Rework to build by autoconf/automake and new Debian scripts

Building in local machine:
    $ sh autogen.sh
    $ ./configure
    $ make
    $ sudo make install

Building Debian package:
    $ debuild -uc -us -b

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I76faa07c1586658d053a3e260ea231a19392f792
This commit is contained in:
Dongjin Kim
2022-01-18 10:10:24 +00:00
parent f78d982959
commit f316f52636
45 changed files with 492 additions and 1387 deletions

View File

@@ -1,84 +0,0 @@
#
# Makefile:
# wiringPi - A "wiring" library for the Raspberry Pi
# https://projects.drogon.net/wiring-pi
#
# Copyright (c) 2012-2013 Gordon Henderson
#################################################################################
# This file is part of wiringPi:
# A "wiring" library for the Raspberry Pi
#
# 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/>.
#################################################################################
ifneq ($V,1)
Q ?= @
endif
#DEBUG = -g -O0
DEBUG = -O3
CC = gcc
INCLUDE = -I/usr/local/include
CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
LDFLAGS = -L/usr/local/lib
LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm
###############################################################################
SRC = blink.c button.c blink-io.c volts.c bright.c
OBJ = $(SRC:.c=.o)
BINS = $(SRC:.c=)
all: $(BINS)
blink: blink.o
$Q echo [link]
$Q $(CC) -o $@ blink.o $(LDFLAGS) $(LDLIBS)
blink-io: blink-io.o
$Q echo [link]
$Q $(CC) -o $@ blink-io.o $(LDFLAGS) $(LDLIBS)
button: button.o
$Q echo [link]
$Q $(CC) -o $@ button.o $(LDFLAGS) $(LDLIBS)
volts: volts.o
$Q echo [link]
$Q $(CC) -o $@ volts.o $(LDFLAGS) $(LDLIBS)
bright: bright.o
$Q echo [link]
$Q $(CC) -o $@ bright.o $(LDFLAGS) $(LDLIBS)
.c.o:
$Q echo [CC] $<
$Q $(CC) -c $(CFLAGS) $< -o $@
clean:
$Q echo "[Clean]"
$Q rm -f $(OBJ) *~ core tags $(BINS)
tags: $(SRC)
$Q echo [ctags]
$Q ctags $(SRC)
depend:
makedepend -Y $(SRC)
# DO NOT DELETE

20
examples/q2w/Makefile.am Normal file
View File

@@ -0,0 +1,20 @@
COMMON_CFLAGS=$(EXTRA_CFLAGS) $(LIBWIRINGPI_CFLAGS)
LIBS=$(LIBWIRINGPI_LIBS)
bin_PROGRAMS = blink button blink-io volts bright
blink_SOURCES = blink.c
blink_CFLAGS = $(COMMON_CFLAGS)
blink_LDADD = -lm
button_SOURCES = button.c
button_CFLAGS = $(COMMON_CFLAGS)
blink_io_SOURCES = blink-io.c
blink_io_CFLAGS = $(COMMON_CFLAGS)
volts_SOURCES = volts.c
volts_CFLAGS = $(COMMON_CFLAGS)
bright_SOURCES = bright.c
bright_CFLAGS = $(COMMON_CFLAGS)