Skip to content

Commit

Permalink
use objs from remote repo
Browse files Browse the repository at this point in the history
  • Loading branch information
lhw2002426 committed Dec 18, 2023
1 parent 18c6f92 commit 3b820de
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 2,187 deletions.
1 change: 1 addition & 0 deletions apps/c/nginx/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ nginx-*
html
*.img
mnt
objs
14 changes: 10 additions & 4 deletions apps/c/nginx/axbuild.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
nginx-version = 1.24.0
nginx-src := $(APP)/nginx-$(nginx-version)
nginx-dir := $(APP)/objs
nginx-objdir := $(APP)/objs
nginx-objs := objs/nginx_app.o

app-objs := $(nginx-objs)
Expand All @@ -12,6 +12,9 @@ nginx-build-args := \
CFLAGS="$(CFLAGS)" \
USE_JEMALLOC=no \
-j
$(info lhw debug CC $(CC) CFLAGS $(CFLAGS) )
$(info lhw debug LD $(LD) LDFLAGS $(LDFLAGS) )
$(info lhw debug copy obj: $(OBJCOPY), $(OUT_ELF))

ifneq ($(V),)
nginx-build-args += V=$(V)
Expand All @@ -28,20 +31,23 @@ disk.img:
echo "nginx makefile create_nginx_img"
./$(APP)/create_nginx_img.sh $(DISK_ARG)

$(nginx-objdir):
git clone https://github.com/lhw2002426/nginx-app.git -b nginx-objs $(APP)/objs

$(nginx-src):
@echo "Download nginx source code"
wget https://nginx.org/download/nginx-$(nginx-version).tar.gz -P $(APP)
tar -zxvf $(APP)/nginx-$(nginx-version).tar.gz -C $(APP) && rm -f $(APP)/nginx-$(nginx-version).tar.gz
cd $(nginx-src) && git init && git add .
# patch -p1 -N -d $(nginx-dir) --no-backup-if-mismatch -r - < $(APP)/nginx.patch
# patch -p1 -N -d $(nginx-objdir) --no-backup-if-mismatch -r - < $(APP)/nginx.patch

$(APP)/$(nginx-objs): build_nginx

clean_c::
find . -type f \( -name "*.o" -o -name "*.elf" -o -name "*.bin" \) -exec rm -f {} +

build_nginx: $(nginx-src) disk.img
cd $(nginx-dir) && $(MAKE) $(nginx-build-args)
build_nginx: $(nginx-src) disk.img $(nginx-objdir)
cd $(nginx-objdir) && $(MAKE) $(nginx-build-args)


.PHONY: build_nginx
Loading

0 comments on commit 3b820de

Please sign in to comment.