summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJames Every <devstopfix@gmail.com>2020-03-25 16:19:15 +0000
committerGitHub <noreply@github.com>2020-03-25 16:19:15 +0000
commit20c4068e5d8bd725c42513301b288094c8857041 (patch)
treebd226f972dfeaed7b11e76158ac1bd2243b89420 /Makefile
parentMerge commit '82cea2a0db4af442a3ea89a340e54fcd11cf8180' (diff)
Convert to ports (#5)
* Remove erlexec dependency * feat: async verify worker has started * test: move infinite to script * fix: timeout response * fix: unix compile [Closes #169398412] * feat: allow database patterns as worker param This allows us to expand paths in an application, which is not possible from the configuration file. * OTP 22 compatible with Elixir 1.7-1.10 * Install make on CI server libmagic-dev contains magic.h Fix this error: ** (Mix) Could not compile with "make" (exit status: 2). * Fix make install * Fix plurality * Fix credo warning * Allow multiple error messages OS X and Linux return different errors messages. * Allow named GenServer processes * Types * Disable test broken in ci Works locally, not in CI. test/gen_magic_test.exs:50 ** (EXIT from #PID<0.1672.0>) shutdown
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 21 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9e366c4..36c427f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
+# Apprentice binary
+
CC = gcc
-CFLAGS = -std=c99 -g -Wall
+CFLAGS = -std=c99 -g -Wall -Werror
LDFLAGS = -lm -lmagic
HEADER_FILES = src
C_SOURCE_FILES = src/apprentice.c
@@ -7,7 +9,18 @@ OBJECT_FILES = $(C_SOURCE_FILES:.c=.o)
EXECUTABLE_DIRECTORY = priv
EXECUTABLE = $(EXECUTABLE_DIRECTORY)/apprentice
-all: $(C_SOURCE_FILES) $(EXECUTABLE)
+# Unit test custom magic file
+
+MAGIC = file
+TEST_DIRECTORY = test
+TARGET_MAGIC = $(TEST_DIRECTORY)/elixir.mgc
+SOURCE_MAGIC = $(TEST_DIRECTORY)/elixir
+
+# Target
+
+all: $(EXECUTABLE) $(TARGET_MAGIC)
+
+# Compile
$(EXECUTABLE): $(OBJECT_FILES) $(EXECUTABLE_DIRECTORY)
$(CC) $(OBJECT_FILES) -o $@ $(LDFLAGS)
@@ -18,5 +31,11 @@ $(EXECUTABLE_DIRECTORY):
.o:
$(CC) $(CFLAGS) $< -o $@
+# Test case
+
+$(TARGET_MAGIC): $(SOURCE_MAGIC)
+ cd $(TEST_DIRECTORY); $(MAGIC) -C -m elixir
+
clean:
rm -f $(EXECUTABLE) $(OBJECT_FILES) $(BEAM_FILES)
+ rm -f $(TEST_DIRECTORY)/*mgc