Skip to content

Commit

Permalink
use git submodule instead of wget
Browse files Browse the repository at this point in the history
  • Loading branch information
andronoob committed Apr 22, 2021
1 parent 9b0a5da commit 70bc845
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ config.h
tags
redsocks
.depend
http-parser*
/gen
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "http-parser"]
path = http-parser
url = https://github.com/nodejs/http-parser/
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-include make.conf

LIBHTTP_VERSION := 2.9.4
LIBHTTP_NAME := http-parser-$(LIBHTTP_VERSION)
LIBHTTP_CFLAGS := -I./http-parser-$(LIBHTTP_VERSION) -L./http-parser-$(LIBHTTP_VERSION)
LIBHTTP_CFLAGS := -I./http-parser -L./http-parser

OBJS := parser.o main.o redsocks.o log.o http-connect.o socks4.o socks5.o http-relay.o base.o base64.o md5.o http-auth.o utils.o redudp.o dnstc.o dnsu2t.o tls.o gen/version.o
ifeq ($(DBG_BUILD),1)
Expand Down Expand Up @@ -32,15 +30,13 @@ all: $(OUT)
tags: *.c *.h
ctags -R

$(LIBHTTP_NAME):
wget https://github.com/nodejs/http-parser/archive/v$(LIBHTTP_VERSION).tar.gz
tar -zxf v$(LIBHTTP_VERSION).tar.gz
rm -f v$(LIBHTTP_VERSION).tar.gz
http-parser-download:
git submodule update --init

$(LIBHTTP_NAME)/libhttp_parser.o:
cd $(LIBHTTP_NAME) && make package
http-parser-build:
cd http-parser && make package

http-parser: $(LIBHTTP_NAME) $(LIBHTTP_NAME)/libhttp_parser.o
http-parser: http-parser-download http-parser-build

$(CONF):
@case `uname` in \
Expand Down Expand Up @@ -116,7 +112,7 @@ clean:
distclean: clean
$(RM) tags $(DEPS)
$(RM) -r gen
$(RM) -rf $(LIBHTTP_NAME)
cd http-parser && make clean

tests/__build-tstamp__: $(OUT) tests/[a-z]* tests/[a-z]*/*
cd tests && ./build
Expand Down
1 change: 1 addition & 0 deletions http-parser
Submodule http-parser added at 2343fd

0 comments on commit 70bc845

Please sign in to comment.