Skip to content

Instantly share code, notes, and snippets.

@isRuslan
Created March 24, 2017 19:19
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 isRuslan/94bb1acbb24a4e3114d7d328877694a7 to your computer and use it in GitHub Desktop.
Save isRuslan/94bb1acbb24a4e3114d7d328877694a7 to your computer and use it in GitHub Desktop.
Make boilerplate
CXX = g++-4.9
CC = gcc-4.9
DOXYGEN = doxygen
CFLAGS = -fdiagnostics-color=always -std=gnu11 -s -c -g3 -O3 -time
WARNINGS = -Werror -Wall -Wextra -pedantic-errors -Wformat=2 -Wno-import -Wimplicit -Wmain -Wchar-subscripts -Wsequence-point -Wmissing-braces -Wparentheses -Winit-self -Wswitch-enum -Wstrict-aliasing=2 -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wdisabled-optimization -Wunused-macros -Wno-unused
LDFLAGS =
LIBRARIES = -lcurl
SOURCES = main.c test.c
OBJECTS = $(SOURCES:.c=.o)
EXECUTABLE = test
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBRARIES)
debug: CFLAGS += -DDEBUG -g
debug: $(SOURCES) $(EXECUTABLE)
.c.o:
$(CC) $< -o $@ $(CFLAGS) $(WARNINGS)
.PHONY: doc clean
doc:
$(DOXYGEN) doxygen.config
clean:
rm -rf $(EXECUTABLE) $(OBJECTS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment