sci/Makefile

68 lines
1.7 KiB
Makefile
Raw Normal View History

2024-08-01 21:35:35 +02:00
# sci - simple continuous integration
# See LICENSE file for copyright and license details.
# Note: If you're confused by the makefile, I do emplore you to read the info-page: $ info make
.POSIX:
NAME=sci
2024-08-02 19:11:12 +02:00
DESCRIPTION=$(NAME) is a simple contiuous integration system.
2024-08-01 21:35:35 +02:00
VERSION = 0.1.0
2024-08-02 19:11:12 +02:00
CC = gcc
2024-08-01 21:35:35 +02:00
OUTDIR := out/
OBJDIR := out/obj
BINDIR := out/bin
2024-08-02 19:11:12 +02:00
CFLAGS += -DSCI_VERSION="\"$(VERSION)\""
CFLAGS += -DSCI_NAME="\"$(NAME)\""
CFLAGS += -DSCI_DESCRIPTION="\"$(DESCRIPTION)\""
CFLAGS += -D_POSIX_C_SOURCE=2
CFLAGS += -D_GNU_SOURCE
2024-08-02 19:11:12 +02:00
CFLAGS += -Wall -Werror -std=c23 -g
CFLAGS += -Iinclude
CFLAGS += -lpthread -luuid
2024-08-01 21:35:35 +02:00
.PHONY: all clean
all: out/bin/sci
out/obj/%.o: src/%.c | $(OBJDIR)
$(CC) -c $? $(CFLAGS) -o $@
2024-08-02 19:11:12 +02:00
OBJ += out/obj/main.o
OBJ += out/obj/cli.o
2024-08-03 09:21:21 +02:00
OBJ += out/obj/log.o
2024-08-02 19:11:12 +02:00
OBJ += out/obj/notify.o
OBJ += out/obj/util.o
OBJ += out/obj/pipeline.o
OBJ += out/obj/threadlist.o
OBJ += out/obj/threadpool.o
2024-08-02 19:11:12 +02:00
out/bin/sci: $(OBJ) | $(BINDIR)
$(CC) -o $@ $(CFLAGS) $^
2024-08-01 21:35:35 +02:00
clean:
2024-08-02 19:11:12 +02:00
rm -rf $(OUTDIR)
2024-08-01 21:35:35 +02:00
$(OUTDIR):
mkdir -p $@
$(OBJDIR): $(OUTDIR)
mkdir -p $@
$(BINDIR): $(OUTDIR)
mkdir -p $@
# dist: clean
# mkdir -p st-$(VERSION)
# cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
# config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
# st-$(VERSION)
# tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
# rm -rf st-$(VERSION)
#
# install: st
# mkdir -p $(DESTDIR)$(PREFIX)/bin
# cp -f st $(DESTDIR)$(PREFIX)/bin
# chmod 755 $(DESTDIR)$(PREFIX)/bin/st
# mkdir -p $(DESTDIR)$(MANPREFIX)/man1
# sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
# chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
# tic -sx st.info
# @echo Please see the README file regarding the terminfo entry of st.