-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (22 loc) · 796 Bytes
/
Makefile
File metadata and controls
32 lines (22 loc) · 796 Bytes
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
31
32
# Makefile for building CQueue
# By: Roneil Rumburg
CC = gcc
# use -g and -O0 here when using a debugger like gdb
CFLAGS = -Wall -pedantic -O2 -std=gnu99
# Project files
HEADERS = cqueue.h
SOURCES = cqueue.c cqueue-test.c
TARGETS = cqueue-test
default: $(TARGETS)
cqueue-test : cqueue.o cqueue-test.o
$(CC) $(CFLAGS) -o $@ $^
# Add additional dependencies for header files (so changes to header
# files cause files including them to be recompiled
Makefile.dependencies:: $(SOURCES) $(HEADERS)
$(CC) $(CFLAGS) -MM $(SOURCES) > Makefile.dependencies
-include Makefile.dependencies
# Phony means not a "real" target, it doesn't build anything
# The phony target "clean" that is used to remove all compiled object files.
.PHONY: clean
clean:
@rm -f $(TARGETS) *.o Makefile.dependencies