Commit c2888d1 1 parent 85c5539 commit c2888d1 Copy full SHA for c2888d1
File tree 5 files changed +39
-45
lines changed
5 files changed +39
-45
lines changed Original file line number Diff line number Diff line change @@ -10,47 +10,37 @@ jobs:
10
10
build :
11
11
strategy :
12
12
matrix :
13
- os :
14
- - " ubuntu-latest "
15
- - " macos-latest "
16
- version :
17
- - " 5.0 "
18
- - " 6.0"
19
- - " 6.2 "
20
- - " 7.0 "
21
- - " 7.2 "
22
- - " 7.4 "
23
- - " unstable "
24
- compiler :
25
- - " gcc "
26
- - " clang "
27
-
28
- exclude :
29
- - os : macos-latest
30
- compiler : gcc
31
- - os : macos-latest
32
- version : " 5.0 "
33
- - os : macos-latest
34
- version : " 6.0 "
35
- - os : macos-latest
36
- version : " 7.0 "
13
+ - os : ubuntu-latest
14
+ compiler : gcc
15
+ version : " 5.0 "
16
+ - os : ubuntu-latest
17
+ compiler : clang
18
+ version : " 6.0"
19
+ - os : ubuntu-latest
20
+ compiler : gcc
21
+ version : " 7.0 "
22
+ - os : ubuntu-latest
23
+ compiler : clang
24
+ version : " 7.2 "
25
+ - os : ubuntu-latest
26
+ compiler : gcc
27
+ version : " 7.4 "
28
+ - os : ubuntu-latest
29
+ compiler : clang
30
+ version : " unstable "
31
+ - os : macos-latest
32
+ compiler : gcc
33
+ version : " 7.4 "
34
+ - os : macos-latest
35
+ compiler : clang
36
+ version : " unstable "
37
37
38
38
runs-on : ${{ matrix.os }}
39
39
40
40
env :
41
41
DEBIAN_FRONTEND : noninteractive
42
42
CC : ${{ matrix.compiler }}
43
43
44
- # TODO: would be nice to connect to a redis server instead of building from source
45
- # services:
46
- # redis:
47
- # image: redis:${{ matrix.version }}
48
- # options: >-
49
- # --health-cmd "redis-cli ping"
50
- # --health-interval 10s
51
- # --health-timeout 5s
52
- # --health-retries 5
53
-
54
44
steps :
55
45
- name : Checkout librdb
56
46
uses : actions/checkout@v4
Original file line number Diff line number Diff line change 1
1
[submodule "deps/hiredis "]
2
2
path = deps/hiredis
3
3
url = https://github.com/redis/hiredis.git
4
+ branch = master
Original file line number Diff line number Diff line change 39
39
rm -f librdb.pc
40
40
rm -f librdb-ext.pc
41
41
42
- distclean : clean
43
-
44
42
example : all
45
43
cd examples && export LD_LIBRARY_PATH=../lib && ./example1
46
44
@@ -128,11 +126,10 @@ help:
128
126
@echo " valgrind - Run tests with static lib and valgrind"
129
127
@echo " example - Run the example"
130
128
@echo " clean - Clean without deps folders"
131
- @echo " distclean - Clean including deps folders"
132
129
@echo " install - install to (DESTDIR)/(PREFIX)/bin and (DESTDIR)/(PREFIX)/lib"
133
130
@echo " By default PREFIX=/usr/local"
134
131
@echo " uninstall - Remove from (DESTDIR)\(PREFIX)/bin and (DESTDIR)/(PREFIX)/lib"
135
132
@echo " help - Prints this message"
136
133
137
134
138
- .PHONY : all debug test valgrind example clean distclean install uninstall build_test help
135
+ .PHONY : all debug test valgrind example clean install uninstall build_test help
Original file line number Diff line number Diff line change 4
4
5
5
clean :
6
6
$(MAKE ) -C redis clean
7
- $(MAKE ) -C hiredis all
7
+ $(MAKE ) -C hiredis clean
8
8
9
9
10
10
.PHONY : all clean
Original file line number Diff line number Diff line change @@ -2,11 +2,12 @@ default: all
2
2
3
3
LIB_DIR = ../../lib
4
4
LIB_NAME = rdb
5
- LIB_NAME_EXT = $(LIB_NAME ) -ext
5
+ LIB_FILENAME = librdb.a
6
+ LIB_NAME_EXT = rdb-ext
7
+ LIB_FILENAME_EXT = librdb-ext.a
6
8
7
9
# Artifacts:
8
- TARGET_APP = rdb-cli
9
- TARGET_LIB_STATIC_EXT = $(LIB_DIR ) /lib$(LIB_NAME_EXT ) .a
10
+ TARGET_APP = rdb-cli
10
11
11
12
# ########################################################################################
12
13
SOURCES = $(notdir $(basename $(wildcard * .c) ) )
@@ -20,10 +21,15 @@ STACK = -fstack-protector-all -Wstack-protector
20
21
WARNS = -Wall -Wextra -pedantic -Werror
21
22
CFLAGS = -fPIC $(OPTIMIZATION ) $(STD ) $(STACK ) $(WARNS )
22
23
DEBUG = -g3 -DDEBUG=1
23
- LIBS = -L /usr/lib -L $(LIB_DIR ) -l $(LIB_NAME_EXT ) -l $(LIB_NAME )
24
+
25
+ ifeq ($(shell uname -s) ,Darwin)
26
+ LIBS = -L $(LIB_DIR ) -l $(LIB_NAME_EXT ) -l $(LIB_NAME )
27
+ else
28
+ LIBS = -L $(LIB_DIR ) -l:$(LIB_FILENAME ) -l:$(LIB_FILENAME_EXT )
29
+ endif
24
30
25
31
ifeq ($(BUILD_TLS ) ,yes)
26
- CFLAGS += -DUSE_OPENSSL=1
32
+ CFLAGS+= -DUSE_OPENSSL =1
27
33
LIBS += -lssl -lcrypto
28
34
endif
29
35
@@ -36,7 +42,7 @@ all: $(TARGET_APP)
36
42
$(TARGET_APP ) : % : % .c lib_dependency
37
43
$(CC ) $(CFLAGS ) -o $@ $< $(DEBUG ) $(LIBS )
38
44
39
- lib_dependency : $(LIB_DIR ) /lib $( LIB_NAME_EXT ) .a
45
+ lib_dependency : $(LIB_DIR ) /$( LIB_FILENAME_EXT )
40
46
41
47
clean :
42
48
@rm -rvf $(TARGETS ) ./* .o ../../bin/$(TARGET_APP )
You can’t perform that action at this time.
0 commit comments