Created
August 6, 2019 12:13
-
-
Save skyhisi/e076644d3716d02e737a9917fb12b847 to your computer and use it in GitHub Desktop.
Enable strict flags in a makefile for specific files
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
# Enable very strict flags for some files to ensure compatibility with | |
# all compilers (enables C99 strict compliance mode and more warnings). | |
STRICTFLAGS := \ | |
-D_XOPEN_SOURCE --std=c99 -pedantic-errors -W -Wall -Wextra \ | |
-Wno-variadic-macros -Wno-overlength-strings -fdiagnostics-show-option | |
STRICTFLAGS_FILES := \ | |
file_a.c \ | |
file_b.c | |
# Use '=' not ':=' to create a makefile macro | |
STRICTFLAGS_MACRO = $(if $(findstring $(notdir $<),$(STRICTFLAGS_FILES)),$(STRICTFLAGS)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment