c - Where do i put CFLAGS in this makefile? Need the -g so i can use gdb debugger -


i'm not used style of makefile teacher created 1 of our homeworks because doesn't have gcc command in it. here makefile. need know put -g cflag.

    ### architecture choice      #uncomment 64-bit     library = libmtron.a      #uncomment 32-bit     #library = libmtron32.a      ### file lists     bins = simulate     objs = driver.o      ### phony targets all/clean      .phony: clean      all: $(bins)      clean:          $(rm) $(bins) $(objs)      ### build rules      # sure link in library     $(bins): $(objs) $(library)      # update if header file changed     driver.o: driver.h mtron.h      simulate: mtron.h 

thanks help!

this makefile utilizing make's built-in set of rules create objects , link executables, rather having type them in yourself.

make has default rule looks (more or less) this:

%.o : %.c         $(cc) $(cppflags) $(cflags) -c -o $@ $< 

if don't specify rule build .o , make needs build 1 , has .c, use default built-in rule.

so, answer question is, "put assignment of cflags wherever want". wherever put it, used default rule.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -