Last active
March 24, 2016 19:45
-
-
Save cgrs/86cc4cf716f5055fd506 to your computer and use it in GitHub Desktop.
Makefile to compile every C file within a directory tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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