Skip to content

Instantly share code, notes, and snippets.

@tinylucid
Created March 11, 2019 12:17
Show Gist options
  • Save tinylucid/d68f3eb4ab8258a71658964adc38ef0e to your computer and use it in GitHub Desktop.
Save tinylucid/d68f3eb4ab8258a71658964adc38ef0e to your computer and use it in GitHub Desktop.
minimal c makefile template
CC = gcc
DEBUG = -ggdb -O0 -march=native
CFLAGS := $(DEBUG) -W -Wall -Wextra -Wpedantic -pedantic -ansi
LDLIBS := -lm
OUTPUT_OPTION = -MMD -MP -o $@
SRC := $(wildcard *.c)
OBJ := $(SRC:.c=.o)
DEP := $(SRC:.c=.d)
-include $(DEP)
.PHONY: clean
all: test1
test1: test1.o
clean:
-rm -f $(OBJ) $(DEP) test1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment