Fixed broken linking

main
Jef Roosens 2022-01-12 18:54:13 +01:00
parent 49e7b9de5d
commit cfcca90dfc
Signed by untrusted user: Jef Roosens
GPG Key ID: 955C0660072F691F
4 changed files with 32 additions and 6 deletions

3
.gitignore vendored
View File

@ -1,6 +1,7 @@
*.c *.c
data/ data/
vieter/vieter vieter.exe
vieter-prod.exe
# Ignore testing files # Ignore testing files
*.pkg* *.pkg*

View File

@ -4,8 +4,20 @@ LARCHIVE_DIR := libarchive-$(LARCHIVE_VER)
LARCHIVE_LIB := $(LARCHIVE_DIR)/.libs/libarchive.a LARCHIVE_LIB := $(LARCHIVE_DIR)/.libs/libarchive.a
# Custom V command for linking libarchive # Custom V command for linking libarchive
V := LD_FLAGS=$(PWD)/$(LARCHIVE_LIB) v -cflags -I$(PWD)/$(LARCHIVE_DIR) V := LDFLAGS=$(PWD)/$(LARCHIVE_LIB) v -cflags -I$(PWD)/$(LARCHIVE_DIR)
# =====COMPILATION=====
.PHONY: vieter
vieter:
$(V) -cg -o vieter.exe vieter
.PHONY: prod
prod:
$(V) -o vieter-prod.exe -prod vieter
# =====EXECUTION=====
# Run the server in the default 'data' directory # Run the server in the default 'data' directory
.PHONY: run .PHONY: run
run: libarchive run: libarchive
@ -16,6 +28,8 @@ run: libarchive
watch: libarchive watch: libarchive
API_KEY=test REPO_DIR=data LOG_LEVEL=DEBUG $(V) watch run vieter API_KEY=test REPO_DIR=data LOG_LEVEL=DEBUG $(V) watch run vieter
# =====OTHER=====
# Format the V codebase # Format the V codebase
.PHONY: fmt .PHONY: fmt
fmt: fmt:
@ -31,6 +45,8 @@ customv:
https://github.com/ChewingBever/v jjr-v https://github.com/ChewingBever/v jjr-v
'$(MAKE)' -C jjr-v '$(MAKE)' -C jjr-v
# =====LIBARCHIVE=====
.PHONY: libarchive .PHONY: libarchive
libarchive: $(LARCHIVE_LIB) libarchive: $(LARCHIVE_LIB)
$(LARCHIVE_LIB): $(LARCHIVE_LIB):

13
vieter/archive.v 100644
View File

@ -0,0 +1,13 @@
module archive
#include "libarchive/archive.h"
#include "libarchive/archive_entry.h"
struct C.archive {}
struct C.archive_entry {}
fn C.archive_read_new() &C.archive
pub fn list_filenames() {
a := C.archive_read_new()
}

View File

@ -2,10 +2,6 @@ module repo
import os import os
#include "libarchive/archive.h"
struct C.archive {}
const pkgs_subpath = 'pkgs' const pkgs_subpath = 'pkgs'
// Dummy struct to work around the fact that you can only share structs, maps & // Dummy struct to work around the fact that you can only share structs, maps &