Compare commits

...

11 Commits

Author SHA1 Message Date
Marc Kleine-Budde 31a59be02f
Merge pull request #588 from marckleinebudde/makefile-detect-libgps
Makefile: rely on pkg-config to detect presence of libgps
2025-03-03 13:24:18 +01:00
Marc Kleine-Budde 4d908bd7cf
Merge pull request #590 from marckleinebudde/fix-makefile-into-ci
github-actions: fix used compiler
2025-03-03 13:22:57 +01:00
Marc Kleine-Budde 837e2bb343 github-actions: fix used compiler
Fixes: 130e0dced2 ("github-actions: compile with gcc and clang using Makefile")
2025-03-03 13:20:50 +01:00
Marc Kleine-Budde ec16ef97ff Makefile: rely on pkg-config to detect presence of libgps
Link: 71b2aec834 (commitcomment-153191516)
Fixes: 71b2aec ("j1939-vehicle-position-srv: Introduce J1939 and NMEA 2000 Vehicle Position Server")
2025-03-03 13:14:05 +01:00
Marc Kleine-Budde 651c8818dd
Merge pull request #589 from marckleinebudde/integrate-makefile-into-ci
github-actions: compile with gcc and clang using Makefile
2025-03-03 13:13:02 +01:00
Marc Kleine-Budde 130e0dced2 github-actions: compile with gcc and clang using Makefile 2025-03-03 13:08:26 +01:00
Marc Kleine-Budde ff90f4ec21
Merge pull request #586 from marckleinebudde/fix-typo-update-gitignore
Fix typos and update gitignore
2025-03-03 10:24:07 +01:00
Marc Kleine-Budde e3ee283443 gitignore: ignore new tools if building with Makefile 2025-03-03 10:18:25 +01:00
Marc Kleine-Budde e8130a3575 treewide: fix typos 2025-03-03 10:18:25 +01:00
Marc Kleine-Budde 1250c12a30
Merge pull request #585 from marckleinebudde/fix-makefile
Makefile: remove erroneous '\'
2025-03-03 10:14:53 +01:00
Marc Kleine-Budde 9b5b030877 Makefile: remove erroneous '\'
This should at least fix the `No rule to make target` error:

```
cc -O2 -Wall -Wno-parentheses -Wsign-compare -I. -Iinclude -DAF_CAN=PF_CAN -DPF_CAN=29 -DSO_RXQ_OVFL=40 -DSCM_TIMESTAMPING_OPT_STATS=54 -DCLOCK_TAI=11 -DSO_TXTIME=61 -DSCM_TXTIME=SO_TXTIME -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE  -c -o j1939_vehicle_position/j1939_vehicle_position_srv.o j1939_vehicle_position/j1939_vehicle_position_srv.c
j1939_vehicle_position/j1939_vehicle_position_srv.c:7:10: fatal error: gps.h: No such file or directory
    7 | #include <gps.h>
      |          ^~~~~~~
compilation terminated.
make: *** [<builtin>: j1939_vehicle_position/j1939_vehicle_position_srv.o] Error 1
make: *** No rule to make target 'cc', needed by 'j1939-vehicle-position-srv'.
make: *** No rule to make target '-lgps', needed by 'j1939-vehicle-position-srv'.
make: *** No rule to make target '-o', needed by 'j1939-vehicle-position-srv'.
```

Link: 71b2aec834 (commitcomment-153191516)
Fixes: 71b2aec834 ("j1939-vehicle-position-srv: Introduce J1939 and NMEA 2000 Vehicle Position Server")
2025-03-03 10:09:48 +01:00
5 changed files with 24 additions and 5 deletions

View File

@ -146,6 +146,20 @@ jobs:
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
podman exec -i stable cmake --build build-${toolchain}
- name: Configure & Build with gcc (Makefile)
env:
cc: gcc
run: |
podman exec -i stable make CC=${cc}
podman exec -i stable make clean
- name: Configure & Build with clang (Makefile)
env:
cc: clang
run: |
podman exec -i stable make CC=${cc}
podman exec -i stable make clean
- name: Show logs
if: ${{ failure() }}
run: |

2
.gitignore vendored
View File

@ -16,6 +16,7 @@ tags
/can-calc-bit-timing
/canbusload
/candump
/canerrsim
/canfdtest
/cangen
/cangw
@ -39,6 +40,7 @@ tags
/j1939sr
/j1939-timedate-cli
/j1939-timedate-srv
/j1939-vehicle-position-srv
/log2asc
/log2long
/mcp251xfd-dump

View File

@ -46,6 +46,7 @@ MAKEFLAGS := -k
CFLAGS := -O2 -Wall -Wno-parentheses -Wsign-compare
HAVE_FORK := $(shell ./check_cc.sh "$(CC)" fork_test.c)
HAVE_LIBGPS := $(shell test -x "`which pkg-config`" && pkg-config --exists libgps && echo 1 || echo 0)
CPPFLAGS += \
-I. \
@ -67,8 +68,10 @@ PROGRAMS_J1939_TIMEDATE := \
j1939-timedate-srv \
j1939-timedate-cli
ifeq ($(HAVE_LIBGPS),1)
PROGRAMS_J1939_VEHICLE_POSITION := \
j1939-vehicle-position-srv
endif
PROGRAMS_ISOBUSFS := \
isobusfs-srv \
@ -193,8 +196,8 @@ j1939-timedate-cli: lib.o \
j1939-vehicle-position-srv: \
lib.o \
libj1939.o \
j1939_vehicle_position/j1939_vehicle_position_srv.o \
$(CC) $(LDFLAGS) $^ $(LDLIBS) -lgps -o $@
j1939_vehicle_position/j1939_vehicle_position_srv.o
$(CC) $(LDFLAGS) $^ $(LDLIBS) $(shell pkg-config --libs libgps) -o $@
isobusfs-srv: lib.o \
libj1939.o \

View File

@ -663,7 +663,7 @@ static int isobusfs_srv_dh_ccd_res(struct isobusfs_srv_priv *priv,
/*
* We assume, the relative path stored in res->name is not longer
* than absolue path
* than absolute path
*/
if (req->name_len > ISOBUSFS_SRV_MAX_PATH_LEN) {
pr_warn("path too long");
@ -697,7 +697,7 @@ static int isobusfs_srv_dh_ccd_res(struct isobusfs_srv_priv *priv,
process_error:
if (ret < 0) {
/* linux_error_to_isobusfs_error() can't distinguish between
* -EINVAL vor SRC and DST, so we have to do it manually.
* -EINVAL for SRC and DST, so we have to do it manually.
*/
if (ret == -EINVAL)
error_code = ISOBUSFS_ERR_INVALID_DST_NAME;

View File

@ -266,7 +266,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "- while (1)\n");
while (todo_echo || todo_recv) {
/*
* re-use peername for storing the sender's peername of
* reuse peername for storing the sender's peername of
* received packets
*/
if (verbose)