Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F115127
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/Makefile b/Makefile
index 77e47dc..0d55236 100644
--- a/Makefile
+++ b/Makefile
@@ -1,40 +1,29 @@
# Apprentice binary
CC = gcc
-CFLAGS = -std=c99 -g -Wall -Wextra -Werror
-LDFLAGS = -lm -lmagic
-HEADER_FILES = src
-C_SOURCE_FILES = src/apprentice.c
-OBJECT_FILES = $(C_SOURCE_FILES:.c=.o)
-EXECUTABLE_DIRECTORY = priv
-EXECUTABLE = $(EXECUTABLE_DIRECTORY)/apprentice
+CFLAGS = -std=c99 -g -Wall -Werror
+LDLIBS = -lm -lmagic
+BEAM_FILES = _build/
+PRIV = priv/
+RM = rm -Rf
# 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)
-
-$(EXECUTABLE_DIRECTORY):
- mkdir -p $(EXECUTABLE_DIRECTORY)
-
-.o:
- $(CC) $(CFLAGS) $< -o $@
+priv/apprentice: src/apprentice.c
+ mkdir -p priv
+ $(CC) $(CFLAGS) $(LDLIBS) $^ -o $@
# Test case
$(TARGET_MAGIC): $(SOURCE_MAGIC)
cd $(TEST_DIRECTORY); $(MAGIC) -C -m elixir
clean:
- rm -f $(EXECUTABLE) $(OBJECT_FILES) $(BEAM_FILES)
+ $(RM) $(PRIV) $(BEAM_FILES)
+
+.PHONY: clean
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Nov 27, 8:59 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40594
Default Alt Text
(1 KB)
Attached To
Mode
R20 majic
Attached
Detach File
Event Timeline
Log In to Comment