summaryrefslogtreecommitdiffstats
path: root/src/hamlib.mk
blob: e71f4ad170acd9143a9a9916fe94aaa6972a59f4 (plain)
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
48
49
50
51
# This file is part of MXE. See LICENSE.md for licensing information.
# visit http://hamlib.org or https://github.com/N0NB/hamlib
# 2016-12-24 Lars Holger Engelhard DL5RCW

PKG             := hamlib
$(PKG)_WEBSITE  := http://www.hamlib.org/
$(PKG)_DESCR    := HamLib
$(PKG)_IGNORE   :=
$(PKG)_VERSION  := 3.0.1
$(PKG)_CHECKSUM := 3fec97ea326d02aa8f35834c4af34194a3f544e6212f391397d788c566b44e32
$(PKG)_SUBDIR   := hamlib-$($(PKG)_VERSION)
$(PKG)_FILE     := Hamlib-$($(PKG)_VERSION).tar.gz
$(PKG)_URL      := https://$(SOURCEFORGE_MIRROR)/project/hamlib/hamlib/$($(PKG)_VERSION)/hamlib-$($(PKG)_VERSION).tar.gz
$(PKG)_URL_2    := https://github.com/N0NB/$(PKG)/archive/$($(PKG)_VERSION).tar.gz
$(PKG)_DEPS     := gcc libltdl libusb1 libxml2 pthreads

# grabbing version from sourceforge
# prefered by Nate N0NB
define $(PKG)_UPDATE
    $(WGET) -q -O- 'https://sourceforge.net/projects/hamlib/files/hamlib/' | \
    $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \
    head -1
endef

## grabbing version from github via MXE
#define $(PKG)_UPDATE
#    $(call MXE_GET_GITHUB_TAGS, N0NB/hamlib)
#endef

define $(PKG)_BUILD
    cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
        $(MXE_CONFIGURE_OPTS) \
        --with-included-ltdl \
        --disable-winradio
    $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' || $(MAKE) -C '$(BUILD_DIR)' -j 1
    $(MAKE) -C '$(BUILD_DIR)' -j 1 install $(MXE_DISABLE_CRUFT)

    # create pkg-config files
    $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
    (echo 'Name: $(PKG)'; \
     echo 'Version: $(hamlib_VERSION)'; \
     echo 'Description: $(PKG)'; \
     echo 'Cflags: -DHAMLIB_LIB'; \
     echo 'Libs: -lhamlib -lpthread -lws2_32';) \
     > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'

    '$(TARGET)-gcc' \
        -W -Wall -Werror -ansi -pedantic \
        '$(PWD)/src/$(PKG)-test.c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
        `'$(TARGET)-pkg-config' --cflags --libs hamlib pthreads`
endef