Skip to content

Commit

Permalink
Updated Makefile and desktop file to support distro packaging
Browse files Browse the repository at this point in the history
Signed-off-by: Jaroslav Škarvada <[email protected]>
  • Loading branch information
yarda committed Jul 10, 2021
1 parent 742658a commit af7d0db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ UNAME_S := $(shell uname -s)
GIT_DATE := $(firstword $(shell git --no-pager show --date=short --format="%ai" --name-only))
GIT_VERSION := $(shell git describe --abbrev=0 --tags)

PREFIX=/usr/local
BINDIR=$(DESTDIR)$(PREFIX)/bin
DATADIR=$(DESTDIR)$(PREFIX)/share

CC=gcc
LINK=gcc

Expand Down Expand Up @@ -273,7 +277,7 @@ actions.o


$(PROGRAM): $(OBJS) $(SOAPYSDR_OBJS) $(CWDAEMON_OBJS) $(MIDI_OBJS)
$(LINK) -o $(PROGRAM) $(OBJS) $(SOAPYSDR_OBJS) $(CWDAEMON_OBJS) $(MIDI_OBJS) $(LIBS)
$(LINK) -o $(PROGRAM) $(LDFLAGS) $(OBJS) $(SOAPYSDR_OBJS) $(CWDAEMON_OBJS) $(MIDI_OBJS) $(LIBS)


all: prebuild $(PROGRAM) $(HEADERS) $(MIDI_HEADERS) $(SOURCES) $(SOAPYSDR_SOURCES) \
Expand All @@ -288,12 +292,12 @@ clean:
-rm -f $(PROGRAM)

install: $(PROGRAM)
cp $(PROGRAM) /usr/local/bin
if [ ! -d /usr/share/linhpsdr ]; then mkdir /usr/share/linhpsdr; fi
cp hpsdr.png /usr/share/linhpsdr
cp hpsdr_icon.png /usr/share/linhpsdr
cp hpsdr_small.png /usr/share/linhpsdr
cp linhpsdr.desktop /usr/share/applications
mkdir -p $(BINDIR) $(DATADIR)/linhpsdr $(DATADIR)/applications $(DATADIR)/icons/hicolor/512x512; \
cp -a $(PROGRAM) $(BINDIR); \
cp -a hpsdr.png $(DATADIR)/linhpsdr; \
cp -a hpsdr_icon.png $(DATADIR)/icons/hicolor/512x512; \
cp -a hpsdr_small.png $(DATADIR)/linhpsdr; \
cp -a linhpsdr.desktop $(DATADIR)/applications \

debian:
cp $(PROGRAM) pkg/linhpsdr/usr/local/bin
Expand Down
4 changes: 1 addition & 3 deletions linhpsdr.desktop
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[Desktop Entry]
Version=0.1
Type=Application
Terminal=false
Name[eb_GB]=linHPSDR
Exec=linhpsdr
Icon=/usr/share/linhpsdr/hpsdr_small.png
Icon=hpsdr_icon
Name=linHPSDR

0 comments on commit af7d0db

Please sign in to comment.