2019-03-05 03:43:53 +03:00
|
|
|
include config.mk
|
|
|
|
|
|
|
|
jets = jets/tree.c $(wildcard jets/*/*.c)
|
|
|
|
noun = $(wildcard noun/*.c)
|
|
|
|
vere = $(wildcard vere/*.c)
|
2019-04-12 23:30:36 +03:00
|
|
|
daemon = $(wildcard daemon/*.c)
|
|
|
|
worker = $(wildcard worker/*.c)
|
2019-03-05 03:43:53 +03:00
|
|
|
|
|
|
|
common = $(jets) $(noun) $(vere)
|
2019-08-02 23:22:18 +03:00
|
|
|
headers = $(shell find include -type f) include/ca-bundle.h
|
2019-03-05 03:43:53 +03:00
|
|
|
|
|
|
|
common_objs = $(shell echo $(common) | sed 's/\.c/.o/g')
|
2019-04-12 23:30:36 +03:00
|
|
|
daemon_objs = $(shell echo $(daemon) | sed 's/\.c/.o/g')
|
|
|
|
worker_objs = $(shell echo $(worker) | sed 's/\.c/.o/g')
|
2019-03-05 03:43:53 +03:00
|
|
|
|
2019-04-12 23:30:36 +03:00
|
|
|
all_objs = $(common_objs) $(daemon_objs) $(worker_objs)
|
|
|
|
all_srcs = $(common) $(daemon) $(worker)
|
2019-06-28 23:29:03 +03:00
|
|
|
all_exes = ./build/mug_tests ./build/jam_tests ./build/hashtable_tests \
|
|
|
|
./build/urbit ./build/urbit-worker
|
2019-03-05 03:43:53 +03:00
|
|
|
|
2019-04-26 01:23:53 +03:00
|
|
|
|
|
|
|
# -Werror promotes all warnings that are enabled into errors (this is on)
|
|
|
|
# -Wall issues all types of errors. This is off (for now)
|
2019-05-02 23:13:48 +03:00
|
|
|
CFLAGS := $(CFLAGS)
|
2019-04-26 01:23:53 +03:00
|
|
|
|
2019-07-10 23:44:02 +03:00
|
|
|
ifeq ($(SSL_CERT_FILE),)
|
|
|
|
$(error SSL_CERT_FILE is undefined)
|
|
|
|
endif
|
2019-04-26 01:23:53 +03:00
|
|
|
|
2019-03-05 03:43:53 +03:00
|
|
|
################################################################################
|
|
|
|
|
2019-04-25 03:27:27 +03:00
|
|
|
.PHONY: all test clean mkproper
|
2019-03-05 03:43:53 +03:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2019-06-28 23:29:03 +03:00
|
|
|
all: $(all_exes)
|
2019-04-25 03:27:27 +03:00
|
|
|
|
2019-06-28 23:29:03 +03:00
|
|
|
test: build/hashtable_tests build/jam_tests build/mug_tests
|
|
|
|
./build/hashtable_tests
|
|
|
|
./build/jam_tests
|
|
|
|
./build/mug_tests
|
2019-03-05 03:43:53 +03:00
|
|
|
|
|
|
|
clean:
|
2019-04-25 03:27:27 +03:00
|
|
|
rm -f ./tags $(all_objs) $(all_exes)
|
2019-03-05 03:43:53 +03:00
|
|
|
|
|
|
|
mrproper: clean
|
2019-08-02 23:22:18 +03:00
|
|
|
rm -f config.mk include/config.h include/ca-bundle.h
|
2019-03-05 03:43:53 +03:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2019-07-10 23:44:02 +03:00
|
|
|
include/ca-bundle.h:
|
|
|
|
@echo XXD -i $(SSL_CERT_FILE)
|
|
|
|
@cat $(SSL_CERT_FILE) > include/ca-bundle.crt
|
|
|
|
@xxd -i include/ca-bundle.crt > include/ca-bundle.h
|
|
|
|
@rm include/ca-bundle.crt
|
|
|
|
|
2019-06-28 23:29:03 +03:00
|
|
|
build/hashtable_tests: $(common_objs) tests/hashtable_tests.o
|
2019-04-25 03:27:27 +03:00
|
|
|
@echo CC -o $@
|
2019-06-28 23:29:03 +03:00
|
|
|
@mkdir -p ./build
|
2019-04-25 03:27:27 +03:00
|
|
|
@$(CC) $^ $(LDFLAGS) -o $@
|
|
|
|
|
2019-06-28 23:29:03 +03:00
|
|
|
build/jam_tests: $(common_objs) tests/jam_tests.o
|
2019-05-12 12:29:13 +03:00
|
|
|
@echo CC -o $@
|
2019-06-28 23:29:03 +03:00
|
|
|
@mkdir -p ./build
|
2019-05-12 12:29:13 +03:00
|
|
|
@$(CC) $^ $(LDFLAGS) -o $@
|
|
|
|
|
2019-06-28 23:29:03 +03:00
|
|
|
build/mug_tests: $(common_objs) tests/mug_tests.o
|
2019-04-25 03:27:27 +03:00
|
|
|
@echo CC -o $@
|
2019-06-28 23:29:03 +03:00
|
|
|
@mkdir -p ./build
|
2019-04-25 03:27:27 +03:00
|
|
|
@$(CC) $^ $(LDFLAGS) -o $@
|
|
|
|
|
2019-06-28 23:29:03 +03:00
|
|
|
build/urbit: $(common_objs) $(daemon_objs)
|
2019-03-05 03:43:53 +03:00
|
|
|
@echo CC -o $@
|
2019-06-28 23:29:03 +03:00
|
|
|
@mkdir -p ./build
|
2019-03-05 03:43:53 +03:00
|
|
|
@$(CC) $^ $(LDFLAGS) -o $@
|
|
|
|
|
2019-06-28 23:29:03 +03:00
|
|
|
build/urbit-worker: $(common_objs) $(worker_objs)
|
2019-03-05 03:43:53 +03:00
|
|
|
@echo CC -o $@
|
2019-06-28 23:29:03 +03:00
|
|
|
@mkdir -p ./build
|
2019-03-05 03:43:53 +03:00
|
|
|
@$(CC) $^ $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
%.o: %.c $(headers)
|
|
|
|
@echo CC $<
|
|
|
|
@$(CC) -I./include $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
tags: $(all_srcs) $(headers)
|
|
|
|
ctags $^
|