Skip to content

Instantly share code, notes, and snippets.

@decal
Last active April 27, 2018 07:34
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 decal/0d357092b5b109a5ee7ae672490d70f5 to your computer and use it in GitHub Desktop.
Save decal/0d357092b5b109a5ee7ae672490d70f5 to your computer and use it in GitHub Desktop.
🎡 GNU Makefile Boilerplate
#
# GNU Makefile boilerplate
#
# Written by: Derek Callaway [decal (AT) sdf {D0T} org]
#
CC = gcco
CFLAGS = -std=c11 -Wall -pedantic -O2 -g -I. -D_FORTITY_SOURCE=2 -fstack-check -fstack-protector-all -fsanitize=alignment
LIBS =
SRCS = count_commas.c count_urlglob.c main_function.c show_urlglob.c showall_urlglob.c array_range.c show_usage.c integer_l
ength.c urlglob_error.c open_bracket.c open_brace.c next_string.c fill_class.c
OBJS = count_commas.o count_urlglob.o main_function.o show_urlglob.o showall_urlglob.o array_range.o show_usage.o integer_l
ength.o urlglob_error.o open_bracket.o open_brace.o next_string.o fill_class.o
OUTS = $(SRCS:.c=)
.PHONY: all clean rebuild
all: $(OBJS)
$(CC) $(CFLAGS) -o urlglob *.o $(LIBS)
rebuild: clean all
$(OUTS): $(SRCS)
$(CC) $(CFLAGS) -c $(subst output,,$@.c) $(LIBS)
clean:
$(RM) $(OUTS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment