forgot to commit this
This commit is contained in:
14 files changed
+353
-20
No files matched your search
@@ -0,0 +1,43 @@
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -std=c11
|
||||
|
||||
#Input file
|
||||
INPUT = input3.txt
|
||||
OUTPUT = output.txt
|
||||
REF = ref3.txt
|
||||
# Source file
|
||||
SRCS = lab6.c
|
||||
# Output
|
||||
TARGET = lab6.out
|
||||
|
||||
# Default target
|
||||
all: $(TARGET)
|
||||
|
||||
# Rule to build the executable
|
||||
$(TARGET): $(SRCS)
|
||||
$(CC) $(CFLAGS) $(SRCS) -o $(TARGET)
|
||||
|
||||
|
||||
convert_input: $(INPUT)
|
||||
dos2unix $(REF)
|
||||
dos2unix $(INPUT)
|
||||
|
||||
convert_output: $(OUTPUT)
|
||||
dos2unix $(OUTPUT)
|
||||
|
||||
check: $(OUTPUT) $(REF)
|
||||
@diff -q $(OUTPUT) $(REF) > /dev/null; \
|
||||
if [ $$? -eq 0 ]; then \
|
||||
echo "Pass"; \
|
||||
else \
|
||||
echo "Fail"; \
|
||||
fi
|
||||
|
||||
# Rule to run the program
|
||||
run: $(TARGET)
|
||||
./$(TARGET) $(INPUT) $(OUTPUT)
|
||||
|
||||
# Rule to clean generated files
|
||||
clean:
|
||||
rm -f $(TARGET)
|
||||
Reference in new issue
Block a user