Skip to content
Snippets Groups Projects
Select Git revision
  • 7ab9d75b405a3ab46bda5a232baa9e88f0c07d6a
  • master default protected
  • develop
3 results

Makefile

Blame
  • Makefile 557 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: loops
    
    # 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.
    loops: loops.c
    	$(CC) $(CFLAGS) -o $@ $<
    
    .PHONY: clean
    clean:
    	rm loops