GCC default parameters (-Werror -Wall..)

currently I'm using this command to compile my .c files in Mint

gcc -std=gnu99 -Wall -Werror filename.c -o filename [-lm]

How do I make these parameters default, perhaps include them in the make filename.c command? Thanks :)

Answers


You need to write makefile like

CC = gcc

EXEC = filename

OBJS =  filename.o \

FLAGS = -std=gnu99 -Wall -Werror

LDLIBS = -lm

all: $(EXEC)

$(EXEC): $(OBJS)
    $(CC) $(FLAGS) -o $@ $(OBJS) $(LDLIBS)

clean:
    -rm -f $(EXEC) *.o

Then run make to compile your file


Need Your Help

Continuing execution even if assert statement fails in selenium using Junit 4 framework

unit-testing selenium selenium-webdriver junit ui-testing

In my test case its compulsory to use multiple assertions. Problem is that if one assertion fails then execution stops. I want that test case continue to execute even after encountering assertion f...