This commit is adding constraint definition and start to modelling something based on OpenBSD cron/at commands. The goal is to have a clear idea of the requirement and prepare developers environment.
55 lines
1.5 KiB
Makefile
55 lines
1.5 KiB
Makefile
######################################################################
|
|
# GNU Makefile
|
|
######################################################################
|
|
BUILDDIR ?= _build
|
|
CC_OPTS += -std=c99 -O2 -Wall -Werror -I/usr/local/include
|
|
CC = cc $(CC_OPTS)
|
|
OBJECTS = $(BUILDDIR)/chored.o \
|
|
$(BUILDDIR)/chored_lib.o \
|
|
$(BUILDDIR)/chored_jobs.o \
|
|
$(BUILDDIR)/chored_worker.o
|
|
|
|
.PHONY += help
|
|
help:
|
|
@echo "Usage: make [all|clean]"
|
|
|
|
######################################################################
|
|
#
|
|
######################################################################
|
|
$(BUILDDIR):
|
|
mkdir -p $@
|
|
|
|
$(BUILDDIR)/chored: $(BUILDDIR) $(OBJECTS)
|
|
$(CC) src/main.c -L/usr/local/lib -levent_core $(BUILDDIR)/*.o -o $@
|
|
|
|
$(BUILDDIR)/chored.o: $(BUILDDIR)
|
|
$(CC) -c src/chored.c -o $@
|
|
|
|
$(BUILDDIR)/chored_lib.o: $(BUILDDIR)
|
|
$(CC) -c src/chored_lib.c -o $@
|
|
|
|
$(BUILDDIR)/chored_jobs.o: $(BUILDDIR)
|
|
$(CC) -c src/chored_jobs.c -o $@
|
|
|
|
$(BUILDDIR)/chored_worker.o: $(BUILDDIR)
|
|
$(CC) -c src/chored_worker.c -o $@
|
|
|
|
TEST += $(BUILDDIR)/chored_worker_test
|
|
$(BUILDDIR)/chored_worker_test: $(BUILDDIR) src/chored_worker.o
|
|
$(CC) src/chored_worker_test.c -L/usr/local/lib -levent_core $(BUILDDIR)/*.o -o $@
|
|
|
|
######################################################################
|
|
#
|
|
######################################################################
|
|
.PHONY += all
|
|
all: $(BUILDDIR)/chored test
|
|
|
|
.PHONY += test
|
|
test: $(TEST)
|
|
|
|
.PHONY += clean
|
|
clean:
|
|
-rm $(BUILDDIR)/chored*
|
|
-rm $(BUILDDIR)/*.o
|
|
|