Drop the broken Makefile

This commit is contained in:
Philipp Schmitt 2014-02-11 15:51:11 +01:00
parent bb472177c7
commit 78a46fafde
3 changed files with 23 additions and 123 deletions

View file

@ -1,7 +1,7 @@
pkgbase = pilight-git
pkgdesc = Modular domotica with the Raspberry Pi
pkgver = v2.0.r0.g172149f
pkgrel = 7
pkgver = v3.0.r2.gf1fecb7
pkgrel = 1
url = http://pilight.org/
arch = x86_64
arch = armv6h
@ -10,11 +10,9 @@ pkgbase = pilight-git
makedepends = gcc
makedepends = glibc
conflicts = pilight
source = git+https://github.com/pilight/pilight.git
source = https://raw.github.com/pschmitt/aur-pilight-git/master/Makefile
source = git+https://github.com/pilight/pilight.git#branch=development
source = https://raw.github.com/pschmitt/aur-pilight-git/master/pilight.service
sha256sums = SKIP
sha256sums = 8669f4366b60f9ff6e17cbab219654a3c81e4e5f0a0e8e79779e3a3297fae760
sha256sums = a6646c4ccb653d17b6b77a3659d96e5d37becd3a0c0daedce48773094ad81e40
pkgname = pilight-git

105
Makefile
View file

@ -1,105 +0,0 @@
GCC = $(CROSS_COMPILE)gcc
SYS := $(shell $(GCC) -dumpmachine)
ifneq (, $(findstring x86_64, $(SYS)))
OSFLAGS = -Ofast -fPIC -march=native -mtune=native -mfpmath=sse -Wconversion -Wunreachable-code -Wstrict-prototypes
endif
ifneq (, $(findstring arm, $(SYS)))
ifneq (, $(findstring gnueabihf, $(SYS)))
OSFLAGS = -Ofast -mfloat-abi=hard -mfpu=vfp -march=armv6 -Wconversion -Wunreachable-code -Wstrict-prototypes
endif
ifneq (, $(findstring gnueabi, $(SYS)))
OSFLAGS = -Ofast -mfloat-abi=hard -mfpu=vfp -march=armv6 -Wconversion -Wunreachable-code -Wstrict-prototypes
endif
ifneq (, $(findstring gnueabisf, $(SYS)))
OSFLAGS = -Ofast -mfloat-abi=soft -mfpu=vfp -march=armv6 -Wconversion -Wunreachable-code -Wstrict-prototypes
endif
endif
ifneq (, $(findstring amd64, $(SYS)))
OSFLAGS = -O3 -fPIC -march=native -mtune=native -mfpmath=sse -Wno-conversion
endif
GIT_HASH := $(shell git describe --always)
CFLAGS = -ffast-math $(OSFLAGS) -Wfloat-equal -Wshadow -Wpointer-arith -Wcast-align -Wstrict-overflow=5 -Wwrite-strings -Waggregate-return -Wcast-qual -Wswitch-default -Wswitch-enum -Wformat=2 -g -Wall -I. -isystem.. -Ilibs/pilight/ -Ilibs/protocols/ -Ilibs/hardwares/ -pthread -lm -DHASH=\"$(GIT_HASH)\"
SUBDIRS = libs/pilight libs/protocols libs/hardwares libs/websockets
SRC = $(wildcard *.c)
INCLUDES = $(wildcard protocols/*.h) $(wildcard protocols/*.c) $(wildcard hardwares/*.h) $(wildcard hardwares/*.c) $(wildcard libs/pilight/*.h) $(wildcard libs/websockets/*.c) $(wildcard libs/websockets/*.h) $(wildcard libs/websockets/*.c)
PROGAMS = $(patsubst %.c,pilight-%,$(SRC))
LIBS = libs/pilight/pilight.o libs/protocols/protocols.o libs/hardwares/hardwares.o libs/websockets/websockets.o
.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS) all
$(SUBDIRS):
$(MAKE) -C $@
all: $(LIBS) libpilight.so libpilight.a $(PROGAMS)
libpilight.so: $(LIBS)
$(GCC) $(LIBS) -shared -o libpilight.so -lpthread -lm -ldl
libpilight.a: $(LIBS)
$(CROSS_COMPILE)ar -rsc libpilight.a $(LIBS)
pilight-daemon: daemon.c $(INCLUDES) $(LIBS) libpilight.so
$(GCC) $(CFLAGS) -o $@ $(patsubst pilight-%,%.c,$@) libpilight.so
pilight-send: send.c $(INCLUDES) $(LIBS) libpilight.so
$(GCC) $(CFLAGS) -o $@ $(patsubst pilight-%,%.c,$@) libpilight.so
pilight-receive: receive.c $(INCLUDES) $(LIBS) libpilight.so
$(GCC) $(CFLAGS) -o $@ $(patsubst pilight-%,%.c,$@) libpilight.so
pilight-debug: debug.c $(INCLUDES) $(LIBS) libpilight.so
$(GCC) $(CFLAGS) -o $@ $(patsubst pilight-%,%.c,$@) libpilight.so
pilight-learn: learn.c $(INCLUDES) $(LIBS) libpilight.so
$(GCC) $(CFLAGS) -o $@ $(patsubst pilight-%,%.c,$@) libpilight.so
pilight-control: control.c $(INCLUDES) $(LIBS) libpilight.so
$(GCC) $(CFLAGS) -o $@ $(patsubst pilight-%,%.c,$@) libpilight.so
pilight-raw: raw.c $(INCLUDES) $(LIBS) libpilight.so
$(GCC) $(CFLAGS) -o $@ $(patsubst pilight-%,%.c,$@) libpilight.so
install:
install -Ddm 0755 -d $(DESTDIR)usr/lib/pilight
install -Ddm 0755 -d $(DESTDIR)usr/bin
install -Ddm 0755 -d $(DESTDIR)etc/pilight
install -Ddm 0755 -d $(DESTDIR)usr/share/webapps/pilight
install -Dm 0655 pilight-daemon $(DESTDIR)usr/bin/
install -Dm 0655 pilight-send $(DESTDIR)usr/bin/
install -Dm 0655 pilight-receive $(DESTDIR)usr/bin/
install -Dm 0655 pilight-control $(DESTDIR)usr/bin/
install -Dm 0655 pilight-debug $(DESTDIR)usr/bin/
install -Dm 0655 pilight-learn $(DESTDIR)usr/bin/
install -Dm 0655 pilight-raw $(DESTDIR)usr/bin/
install -Dm 0655 libpilight.so $(DESTDIR)usr/lib/pilight/
install -Dm 0655 libpilight.a $(DESTDIR)usr/lib/pilight/
install -Dm 0644 settings.json-default $(DESTDIR)etc/pilight/settings.json
install -Dm 0644 web/index.html $(DESTDIR)usr/share/webapps/pilight/
install -Dm 0644 web/pilight.css $(DESTDIR)usr/share/webapps/pilight/
install -Dm 0644 web/pilight.js $(DESTDIR)usr/share/webapps/pilight/
install -Dm 0644 web/favicon.ico $(DESTDIR)usr/share/webapps/pilight/
install -Dm 0644 web/logo.png $(DESTDIR)usr/share/webapps/pilight/
install -Dm 0644 web/battery_green.png $(DESTDIR)usr/share/webapps/pilight/
install -Dm 0644 web/battery_red.png $(DESTDIR)usr/share/webapps/pilight/
install -Dm 0644 web/apple-touch-icon-iphone-retina-display.png $(DESTDIR)usr/share/webapps/pilight/
install -Dm 0644 web/apple-touch-icon-ipad.png $(DESTDIR)usr/share/webapps/pilight/
install -Dm 0644 web/apple-touch-icon-iphone.png $(DESTDIR)usr/share/webapps/pilight/
mv $(DESTDIR)usr/lib/pilight/libpilight.so $(DESTDIR)usr/lib/pilight/libpilight.so.2
ln -sf /usr/lib/pilight/libpilight.so.2 $(DESTDIR)usr/lib/libpilight.so
clean:
rm pilight-* >/dev/null 2>&1 || true
rm *pilight*.so* >/dev/null 2>&1 || true
rm *pilight*.a* >/dev/null 2>&1 || true
$(MAKE) -C libs/protocols/ $@;
dist-clean:
rm pilight-* >/dev/null 2>&1 || true
rm *pilight*.so* >/dev/null 2>&1 || true
rm *pilight*.a* >/dev/null 2>&1 || true
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@; \
done

View file

@ -2,18 +2,16 @@
pkgname=pilight-git
_pkgname=pilight
pkgver=v2.0.r0.g172149f
pkgrel=7
pkgver=v3.0.r2.gf1fecb7
pkgrel=1
pkgdesc='Modular domotica with the Raspberry Pi'
arch=('x86_64' 'armv6h')
url="http://pilight.org/"
license=('GPL3')
makedepends=('git' 'gcc' 'glibc')
source=('git+https://github.com/pilight/pilight.git'
'https://raw.github.com/pschmitt/aur-pilight-git/master/Makefile'
source=('git+https://github.com/pilight/pilight.git#branch=development'
'https://raw.github.com/pschmitt/aur-pilight-git/master/pilight.service')
sha256sums=('SKIP'
'8669f4366b60f9ff6e17cbab219654a3c81e4e5f0a0e8e79779e3a3297fae760'
sha256sums=('SKIP'
'a6646c4ccb653d17b6b77a3659d96e5d37becd3a0c0daedce48773094ad81e40')
conflicts=('pilight')
@ -24,23 +22,32 @@ pkgver() {
prepare() {
cd "${srcdir}/${_pkgname}"
sed -i 's|\("webserver-root"\): "/usr/local/share/pilight/"|\1: "/usr/share/webapps/pilight"|' settings.json-default
cp -f "${srcdir}/Makefile" Makefile
for f in $(grep -IRl 'pilight.h"' .); do
sed -i 's|\(#include .*pilight.h\)"|\1.in"|g' $f
done
sed -i 's/#cmakedefine/#define/g' pilight.h.in
# Fix zlib path
sed -i 's|\(/usr/lib/\).*/\(libz.so\)|\1\2|g' CMakeLists.txt
sed -i 's|\("webserver-root"\): "/usr/local/share/pilight/"|\1: "/usr/share/webapps/pilight"|' settings.json-default
}
build() {
cd "${srcdir}/${_pkgname}"
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .
make
}
package() {
cd "${srcdir}/${_pkgname}"
make DESTDIR="$pkgdir/" install
install -Dm644 "${srcdir}/pilight.service" "${pkgdir}/usr/lib/systemd/system/pilight.service"
# Fix paths
cd "${pkgdir}"
mv usr/sbin usr/bin
mv usr/lib/pilight/libpilight.so.2 usr/lib/libpilight.so.2
ln -s usr/lib/libpilight.so.2 usr/lib/libpilight.so
mkdir -p usr/share/webapps/${_pkgname}
mv usr/local/share/${_pkgname}/default usr/share/webapps/${_pkgname}
# Cleanup
rm -rf usr/local usr/lib/pilight etc/init.d
}