diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2026-09-08 01:50:55 +0200 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2026-09-08 01:50:55 +0200 |
| commit | 046ce317bb7e1cfeba947ace6aea237cb0f91e2d (patch) | |
| tree | 8d83cdaa6c9a1b1176e3d9773f650465f9fe4b17 /Makefile | |
| parent | cd6d183fc8cd96cfb14de1ee0800d2613297012d (diff) | |
Back to Shell
I ended up fighting with C for no benefit. We are back to a Shell
script, but this time we use (mostly) POSIX shell (we use `local`
because it is so convenient, although it is technically not POSIX).
Additionally, this time we create a monolithic script, and already
add hooks to allow for multiple contianer engines to work with the
script (for now, just `container` is implemented and `podman krun`
is stubbed).
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 36 |
1 files changed, 14 insertions, 22 deletions
@@ -1,33 +1,25 @@ +.POSIX: -CONTAINER = $(if $(findstring Darwin,$(shell uname -s)),container,podman) +PREFIX = $(HOME)/.local +INSTALL = install -CC = cc -CFLAGS = -Wall -Wextra -O2 -LDFLAGS = +ifeq ($(OS),Darwin) + CONTAINER = container +else + CONTAINER = podman +endif -SRCS = src/cmd_create.c \ - src/err.c \ - src/engine_$(CONTAINER).c \ - src/fs.c \ - src/main.c \ - src/proc.c \ - src/ssh.c -OBJS = $(patsubst %.c,%.o,$(SRCS)) IMAGE = ghcr.io/nlordell/dbx:latest .PHONY: all -all: dbx ; +all: + @echo "usage: make [install|container]" -dbx: $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ - -%.o: %.c src/dbx.h - $(CC) $(CFLAGS) -c -o $@ $< +.PHONY: install +install: dbx + $(INSTALL) -d $(PREFIX)/bin + $(INSTALL) -m 755 dbx $(PREFIX)/bin/dbx .PHONY: container container: container/Containerfile container/init $(CONTAINER) build --tag $(IMAGE) container - -.PHONY: clean -clean: - rm -f dbx src/*.o |
