summaryrefslogtreecommitdiff
path: root/src/c/exercise1/Makefile
blob: 9a5793bc2ac61c36dc3f8023d2b69425f143e7ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Minimal Makefile to compile count.c into an executable named main

# Compiler
CC = gcc


# Flags
CFLAGS = -Wall -Wextra -O2


# Default target
# Tells make what dependencies to compile
all: count


# Dependency 'count'
# count.c is the source file
count: count.c
	$(CC) $(CFLAGS) -o count count.c


# Test target 
test: count
	@echo -n "count.c test............................"
	@./count >/dev/null 2>&1 && echo "OK" || echo "FAILED"


# Clean target
clean:
	rm -f count