forked from vieter-v/vieter
Still trying to just link some stuff bro
This commit is contained in:
parent
cfcca90dfc
commit
05e725eb4e
11 changed files with 43 additions and 28 deletions
32
Makefile
32
Makefile
|
|
@ -1,31 +1,37 @@
|
|||
# =====CONFIG=====
|
||||
SRC_DIR := src
|
||||
SOURCES != find '$(SRC_DIR)' -iname '*.v'
|
||||
|
||||
LARCHIVE_VER := 3.5.2
|
||||
LARCHIVE_DIR := libarchive-$(LARCHIVE_VER)
|
||||
LARCHIVE_LIB := $(LARCHIVE_DIR)/.libs/libarchive.a
|
||||
LARCHIVE_LIB := $(LARCHIVE_DIR)/libarchive/libarchive.so
|
||||
|
||||
# Custom V command for linking libarchive
|
||||
V := LDFLAGS=$(PWD)/$(LARCHIVE_LIB) v -cflags -I$(PWD)/$(LARCHIVE_DIR)
|
||||
# V := LDFLAGS=$(PWD)/$(LARCHIVE_LIB) v -cflags '-I$(PWD)/$(LARCHIVE_DIR) -I $(PWD)/$(LARCHIVE_DIR)'
|
||||
V := v
|
||||
|
||||
|
||||
# =====COMPILATION=====
|
||||
.PHONY: vieter
|
||||
vieter:
|
||||
$(V) -cg -o vieter.exe vieter
|
||||
.PHONY: debug
|
||||
debug: vieter
|
||||
vieter: $(SOURCES)
|
||||
$(V) -cg -o vieter $(SRC_DIR)
|
||||
|
||||
.PHONY: prod
|
||||
prod:
|
||||
$(V) -o vieter-prod.exe -prod vieter
|
||||
prod: vieter-prod
|
||||
vieter-prod: $(SOURCES)
|
||||
$(V) -o vieter-prod -prod $(SRC_DIR)
|
||||
|
||||
|
||||
# =====EXECUTION=====
|
||||
# Run the server in the default 'data' directory
|
||||
.PHONY: run
|
||||
run: libarchive
|
||||
API_KEY=test REPO_DIR=data LOG_LEVEL=DEBUG $(V) run vieter
|
||||
run: vieter
|
||||
API_KEY=test REPO_DIR=data LOG_LEVEL=DEBUG ./vieter
|
||||
|
||||
# Same as run, but restart when the source code changes
|
||||
.PHONY: watch
|
||||
watch: libarchive
|
||||
watch:
|
||||
API_KEY=test REPO_DIR=data LOG_LEVEL=DEBUG $(V) watch run vieter
|
||||
|
||||
|
||||
|
|
@ -33,7 +39,7 @@ watch: libarchive
|
|||
# Format the V codebase
|
||||
.PHONY: fmt
|
||||
fmt:
|
||||
v fmt -w vieter
|
||||
v fmt -w $(SRC_DIR)
|
||||
|
||||
# Pulls & builds my personal build of the v compiler, required for this project to function
|
||||
.PHONY: customv
|
||||
|
|
@ -51,8 +57,8 @@ customv:
|
|||
libarchive: $(LARCHIVE_LIB)
|
||||
$(LARCHIVE_LIB):
|
||||
curl -o - "https://libarchive.org/downloads/libarchive-${LARCHIVE_VER}.tar.gz" | tar xzf -
|
||||
cd "libarchive-${LARCHIVE_VER}" && ./configure --disable-bsdtar --disable-bsdcpio
|
||||
cd "libarchive-${LARCHIVE_VER}" && cmake .
|
||||
'$(MAKE)' -C "libarchive-${LARCHIVE_VER}"
|
||||
|
||||
clean:
|
||||
rm -rf '$(LARCHIVE_DIR)' 'data'
|
||||
rm -rf '$(LARCHIVE_DIR)' 'data' 'vieter' 'vieter-prod'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue