File: Makefile

package info (click to toggle)
qcontrol 0.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 384 kB
  • ctags: 357
  • sloc: ansic: 2,020; sh: 241; makefile: 64
file content (47 lines) | stat: -rw-r--r-- 1,491 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
VERSION=0.5.5

CFLAGS   += -c -g -Os -Wall -Wextra
CPPFLAGS += -DQCONTROL_VERSION=\"$(VERSION)\"

LDFLAGS  += -g
LIBS     += -lpthread
LIBS_STATIC += /usr/lib/$$(dpkg-architecture -qDEB_HOST_MULTIARCH)/liblua5.1.a -lpthread -lm -ldl

CFLAGS   += $(shell pkg-config --cflags lua5.1)
LIBS     += $(shell pkg-config --libs lua5.1)

ifeq ($(shell pkg-config --exists libsystemd-daemon 2>/dev/null && echo 1),1)
CPPFLAGS += -DHAVE_SYSTEMD
CFLAGS   += $(shell pkg-config --cflags libsystemd-daemon)
LIBS     += $(shell pkg-config --libs libsystemd-daemon)
endif

SOURCES=qcontrol.c system.c qnap-pic.c ts209.c ts219.c ts409.c ts41x.c evdev.c a125.c synology.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=qcontrol

all:	$(SOURCES) $(EXECUTABLE) $(EXECUTABLE)-static

$(EXECUTABLE): $(OBJECTS)
	$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@

$(EXECUTABLE)-static: $(OBJECTS)
	$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS_STATIC) -o $@

.c.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) $< -o $@

clean:
	rm -f $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE)-static

dist: RELEASES := $(PWD)/../releases/
dist: TARBALL := qcontrol-$(VERSION).tar
dist: TAG := v$(VERSION)
dist:
	git tag -v $(TAG)
	git archive --format=tar --prefix=qcontrol-$(VERSION)/ --output $(RELEASES)/$(TARBALL) $(TAG)
	cat $(RELEASES)/$(TARBALL) | gzip -c9 > $(RELEASES)/$(TARBALL).gz
	xz --stdout --compress $(RELEASES)/$(TARBALL) > $(RELEASES)/$(TARBALL).xz
	cd $(RELEASES) && sha256sum $(TARBALL) $(TARBALL).gz $(TARBALL).xz > $(TARBALL).sha256

$(OBJECTS): picmodule.h