init project
This commit is contained in:
parent
4591f54873
commit
7568057b36
2
.gitignore
vendored
2
.gitignore
vendored
@ -107,3 +107,5 @@ dkms.conf
|
||||
*.out
|
||||
*.app
|
||||
|
||||
*.xo
|
||||
*.so
|
||||
|
11
Makefile
Normal file
11
Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
default: all
|
||||
|
||||
.DEFAULT:
|
||||
cd src && $(MAKE) $@
|
||||
|
||||
install:
|
||||
cd src && $(MAKE) $@
|
||||
|
||||
.PHONY: install
|
||||
|
28
src/Makefile
Normal file
28
src/Makefile
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
||||
|
||||
# Compile flags for linux / osx
|
||||
ifeq ($(uname_S),Linux)
|
||||
SHOBJ_CFLAGS ?= -W -Wall -fno-common -g -ggdb -std=c99 -O2
|
||||
SHOBJ_LDFLAGS ?= -shared
|
||||
else
|
||||
SHOBJ_CFLAGS ?= -W -Wall -dynamic -fno-common -g -ggdb -std=c99 -O2
|
||||
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
|
||||
endif
|
||||
|
||||
.SUFFIXES: .c .so .xo .o
|
||||
|
||||
|
||||
.c.xo:
|
||||
$(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
|
||||
|
||||
all: redis-acl.so
|
||||
|
||||
|
||||
redis-acl.xo: ./redismodule.h
|
||||
|
||||
redis-acl.so: redis-acl.xo
|
||||
$(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc
|
||||
|
||||
clean:
|
||||
rm -rf *.xo *.so
|
7
src/redis-acl.c
Normal file
7
src/redis-acl.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include "redismodule.h"
|
||||
|
||||
int main(){
|
||||
printf("Hello world\n");
|
||||
return 0;
|
||||
}
|
1548
src/redismodule.h
Normal file
1548
src/redismodule.h
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user