#CFLAGS = -O2 -g -c -pedantic -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fno-strict-aliasing -std=gnu99 -DGCC_PRINTF -DGCC_SCANF CFLAGS = -g -c -pedantic -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fno-strict-aliasing -std=gnu99 -DGCC_PRINTF -DGCC_SCANF LDFLAGS= CC=gcc LD=$(CC) YACC=bison FLEX=flex ECOMP=echo "`tput smso`Compiling $<`tput rmso`" ELINK=echo "`tput smso`Linking $@`tput rmso`" EYACC=echo "`tput smso`Yaccing $<`tput rmso`" EFLEX=echo "`tput smso`Flexing $<`tput rmso`" base= -lm rest= -lpanel -lmenu -lform -lcurses $(base) ######################################################### all : \ fmli \ test \ remove_empty_error_files test : \ test.o \ fmli_lex.o @$(ELINK) @$(LD) $(LDFLAGS) -o $@ \ test.o \ fmli_lex.o test.o : \ test.c @$(ECOMP) @$(CC) $(CFLAGS) $< 2>$*.err fmli_lex.o : \ fmli_lex.c \ fmli_parse.h @$(ECOMP) @$(CC) $(CFLAGS) $< 2>$*.err fmli_lex.c : \ fmli_lex.l @$(EFLEX) @$(FLEX) -Cem -B -t $< >$@ 2>$*.err # @$(FLEX) -Cem -d -B -p -p -s -t $< >$@ 2>$*.err fmli : \ fmli.o \ fmli_parse.o \ fmli_lex.o @$(ELINK) @$(LD) $(LDFLAGS) -o $@ \ fmli.o \ fmli_parse.o \ fmli_lex.o \ $(rest) fmli_parse.o : \ fmli_parse.c \ fmli.h @$(ECOMP) @$(CC) $(CFLAGS) $< 2>$*.err fmli.o : \ fmli.c \ fmli.h @$(ECOMP) @$(CC) $(CFLAGS) $< 2>$*.err fmli_parse.c fmli_parse.h : \ fmli_parse.y @$(EYACC) @$(YACC) -d $< -o $@ 2>$*.err # remove empty compiler/linker error listing files remove_empty_error_files: @echo "Removing `tput smso`empty error`tput rmso` files" @find . -name '*.err' -size 0 -exec rm {} \; @touch _.err @echo "Have `tput smso``cat *.err | wc -l``tput rmso` warnings" clean : rm -f *.o *.err fmli_parse.[ch] fmli_lex.c rm -f fmli test # End of makefile