-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
47 lines (37 loc) · 1.06 KB
/
Makefile
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
# App info
APPNAME = bluefog
VERSION = 0.0.4
# Compiler and options
CC = gcc
CFLAGS += -Wall -O2 -Wno-unused-function
# Libraries to link
LIBS = -lbluetooth -lpthread
# Files
SOURCES = bluefog.c bdaddr.c devicenames.h
DOCS = ChangeLog COPYING README
# Targets
# Build
$(APPNAME): $(SOURCES)
$(CC) $(CFLAGS) $(SOURCES) $(LIBS) -o $(APPNAME)
# Build tarball
release: clean
tar --exclude='.*' -C ../ -czvf /tmp/$(APPNAME)-$(VERSION).tar.gz $(APPNAME)-$(VERSION)
# Clean for dist
clean:
rm -rf $(APPNAME) *.o *.txt *.log
# Install to system
install: $(APPNAME)
mkdir -p $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/usr/share/doc/$(APPNAME)-$(VERSION)/
cp $(APPNAME) $(DESTDIR)/usr/bin/
cp -a $(DOCS) $(DESTDIR)/usr/share/doc/$(APPNAME)-$(VERSION)/
# Upgrade from previous source install
upgrade: removeold install
# Remove current version from system
uninstall:
rm -rf $(DESTDIR)/usr/share/doc/$(APPNAME)-$(VERSION)/
rm -f $(DESTDIR)/usr/bin/$(APPNAME)
# Remove older versions
removeold:
rm -rf $(DESTDIR)/usr/share/doc/$(APPNAME)*
rm -f $(DESTDIR)/usr/bin/$(APPNAME)