Makefile
changeset 71 9ac5a589211e
parent 70 ded389a5dc2a
child 73 d0578510aea1
equal deleted inserted replaced
70:ded389a5dc2a 71:9ac5a589211e
     1      CC = gcc -g -ggdb $(PROF)
     1      CC = gcc -g -ggdb $(PROF)
     2     CPP = g++ -g -ggdb $(PROF)
     2     CPP = g++ -g -ggdb $(PROF)
     3  CFLAGS = -Wall -O2 -Iinclude -ansi
     3  CFLAGS = -Wall -O2 -Iinclude -ansi
       
     4      RM = rm -f
       
     5    FIND = find
       
     6 
     4 ifeq ("$(PROFILING)", "linux")
     7 ifeq ("$(PROFILING)", "linux")
     5    PROF = -fprofile-arcs -ftest-coverage -pg
     8    PROF = -fprofile-arcs -ftest-coverage -pg
     6 endif
     9 endif
     7 
    10 
     8 TARGET  = ncurses
    11 TARGET  = ncurses
   299 	@$(CC) -o $@ $<
   302 	@$(CC) -o $@ $<
   300 
   303 
   301 .PHONY: beauty clean uninstall
   304 .PHONY: beauty clean uninstall
   302 
   305 
   303 clean:
   306 clean:
   304 	find -name '*~' -exec rm -f {} \;
   307 ifdef FIND
   305 	find -name '*.[oa]' -exec rm -f {} \;
   308 	$(FIND) -name '*~' -exec $(RM) {} \;
   306 	find -name '*.gcov' -exec rm -f {} \;
   309 	$(FIND) -name '*.[oa]' -exec $(RM) {} \;
   307 	find -name '*.gcda' -exec rm -f {} \;
   310 	$(FIND) -name '*.gcov' -exec $(RM) {} \;
   308 	find -name '*.gcno' -exec rm -f {} \;
   311 	$(FIND) -name '*.gcda' -exec $(RM) {} \;
   309 	find -name 'gmon.out' -exec rm -f {} \;
   312 	$(FIND) -name '*.gcno' -exec $(RM) {} \;
   310 	rm -f $(TARGET)
   313 	$(FIND) -name 'gmon.out' -exec $(RM) {} \;
       
   314 endif
       
   315 	$(RM) $(TARGET)
   311 
   316 
   312 beauty:
   317 beauty:
   313 	find -name '*.[ch]' -exec indent {} \;
   318 ifdef FIND
   314 	find -name '*.[ch]' -exec eraser {} \;
   319 	$(FIND) -name '*.[ch]' -exec indent {} \;
   315 	find -name 'Makefile*' -exec eraser {} \;
   320 	$(FIND) -name '*.[ch]' -exec eraser {} \;
       
   321 	$(FIND) -name 'Makefile*' -exec eraser {} \;
       
   322 endif
   316 	@make clean
   323 	@make clean