Select Git revision
Makefile 760 B
# Change your compiler here if you're not using gcc. CC is for C, and CXX is for C++.
CC = gcc
CXX = g++
CFLAGS = -Wall -O3
.PHONY: all
all: basic_types control_structures functions
# Here I'm using some of Make's built in variables: $@ and $<. The former gets substituted with the
# name of the target. In this case, that's "loops". The latter gets substituted with the first
# prerequisite. In this case, that's "loops.c". These are hard to remember, but can save you some
# typing if you decide to rename things.
basic_types: basic_types.c
$(CC) $(CFLAGS) -o $@ $<
control_structures: control_structures.c
$(CC) $(CFLAGS) -o $@ $<
functions: functions.c
$(CC) $(CFLAGS) -o $@ $<
.PHONY: clean
clean:
rm -f basic_types control_structures functions