Improved makefile
This commit is contained in:
parent
6e57f0659c
commit
880222a65d
7
makefile
7
makefile
@ -5,12 +5,15 @@ GOBUILD=$(GOCMD) build
|
||||
GOINSTALL=$(GOCMD) install
|
||||
GOTEST=$(GOCMD) test
|
||||
BUILDJOBS=@./jobs/build.sh
|
||||
BUILDPATCHES=@./patches/build.sh
|
||||
IPTABLES=@sudo iptables
|
||||
|
||||
server:
|
||||
$(GOBUILD)
|
||||
jobs:
|
||||
$(BUILDJOBS)
|
||||
patches:
|
||||
$(BUILDPATCHES)
|
||||
install:
|
||||
$(GOINSTALL)
|
||||
test:
|
||||
@ -24,9 +27,11 @@ assets:
|
||||
@pack
|
||||
depslist:
|
||||
$(GOCMD) list -f {{.Deps}} | sed -e 's/\[//g' -e 's/\]//g' | tr " " "\n"
|
||||
clean:
|
||||
find . -type f | xargs file | grep "ELF.*executable" | awk -F: '{print $1}' | rm
|
||||
ports:
|
||||
$(IPTABLES) -t nat -A OUTPUT -o lo -p tcp --dport 80 -j REDIRECT --to-port 4000
|
||||
$(IPTABLES) -t nat -A OUTPUT -o lo -p tcp --dport 443 -j REDIRECT --to-port 4001
|
||||
all: assets server jobs ports
|
||||
all: assets server jobs patches ports
|
||||
|
||||
.PHONY: jobs
|
6
patches/.gitignore
vendored
Normal file
6
patches/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
*
|
||||
!*/
|
||||
!*.go
|
||||
!*.sh
|
||||
!README.md
|
||||
!.gitignore
|
4
patches/build.sh
Executable file
4
patches/build.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
MYDIR="$(dirname "$(realpath "$0")")"
|
||||
cd "$MYDIR"
|
||||
for dir in ./*; do ([ -d "$dir" ] && cd "$dir" && echo "Building $dir" && go build); done
|
Loading…
Reference in New Issue
Block a user