aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 14 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 867f413..b2bb4fe 100644
--- a/Makefile
+++ b/Makefile
@@ -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