blob: 876f1182fa310490b3ccdc2ad66560ec4e95b640 (
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 hello.c into an executable named main
# Compiler
CC = gcc
# Flags
CFLAGS = -Wall -Wextra -O2
# Default target
# Tells make what dependencies to compile
all: hello
# Dependency 'hello'
# hello.c is the source file
hello: hello.c
$(CC) $(CFLAGS) -o hello hello.c
# Test target
test: hello
@echo -n "hello.c test............................"
@./hello >/dev/null 2>&1 && echo "OK" || echo "FAILED"
# Clean target
clean:
rm -f hello
|