Skip to content

Instantly share code, notes, and snippets.

@cgrs
Last active March 24, 2016 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgrs/86cc4cf716f5055fd506 to your computer and use it in GitHub Desktop.
Save cgrs/86cc4cf716f5055fd506 to your computer and use it in GitHub Desktop.
Makefile to compile every C file within a directory tree
CC = gcc
CFLAGS = -O2
SOURCES := $(shell find -name '*.c')
BINARIES := $(patsubst %.c,%,$(SOURCES))
default:
@echo "make what?"
.PHONY: clean
clean:
rm -f $(BINARIES)
all: $(BINARIES)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment