Makefile
changeset 70 ded389a5dc2a
parent 67 abe63a276a36
child 71 9ac5a589211e
equal deleted inserted replaced
69:b5912e5f899f 70:ded389a5dc2a
     1      CC = gcc -g -ggdb
     1      CC = gcc -g -ggdb $(PROF)
     2     CPP = g++ -g -ggdb
     2     CPP = g++ -g -ggdb $(PROF)
     3  CFLAGS = -Wall -O2 -Iinclude -ansi
     3  CFLAGS = -Wall -O2 -Iinclude -ansi
       
     4 ifeq ("$(PROFILING)", "linux")
       
     5    PROF = -fprofile-arcs -ftest-coverage -pg
       
     6 endif
     4 
     7 
     5 TARGET  = ncurses
     8 TARGET  = ncurses
     6 TARGET += numerierung
     9 TARGET += numerierung
     7 TARGET += xdemo
    10 TARGET += xdemo
     8 TARGET += signals
    11 TARGET += signals
   209 	@echo Linking $< ...
   212 	@echo Linking $< ...
   210 	@$(CPP) -o $@ $<
   213 	@$(CPP) -o $@ $<
   211 
   214 
   212 lotto: lotto.o
   215 lotto: lotto.o
   213 	@echo Linking $< ...
   216 	@echo Linking $< ...
   214 	@$(CPP) -o $@ $<
   217 	@$(CC) -o $@ $<
   215 
   218 
   216 mem2swap: mem2swap.o set_limit.o
   219 mem2swap: mem2swap.o set_limit.o
   217 	@echo Linking $< ...
   220 	@echo Linking $< ...
   218 	@$(CPP) -o $@ mem2swap.o set_limit.o
   221 	@$(CC) -o $@ mem2swap.o set_limit.o
   219 
   222 
   220 prog_limit: prog_limit.o set_limit.o
   223 prog_limit: prog_limit.o set_limit.o
   221 	@echo Linking $< ...
   224 	@echo Linking $< ...
   222 	@$(CPP) -o $@ prog_limit.o set_limit.o
   225 	@$(CC) -o $@ prog_limit.o set_limit.o
   223 
   226 
   224 database: database.c
   227 database: database.c
   225 	@echo Compiling $< ...
   228 	@echo Compiling $< ...
   226 	@$(CC) -c -I$(shell pg_config --includedir) $<
   229 	@$(CC) -c -I$(shell pg_config --includedir) $<
   227 	@echo Linking $< ...
   230 	@echo Linking $< ...
   228 	@$(CC) -lpq -o $@ $@.o
   231 	@$(CC) -lpq -o $@ $@.o
   229 
   232 
   230 gauss: gauss.o
   233 gauss: gauss.o
   231 	@echo Linking $< ...
   234 	@echo Linking $< ...
   232 	@$(CPP) -o $@ $<
   235 	@$(CC) -o $@ $<
   233 
   236 
   234 connection: connection.o
   237 connection: connection.o
   235 	@echo Linking $< ...
   238 	@echo Linking $< ...
   236 	@$(CPP) -o $@ $<
   239 	@$(CC) -o $@ $<
   237 
   240 
   238 copy: copy.o
   241 copy: copy.o
   239 	@echo Linking $< ...
   242 	@echo Linking $< ...
   240 	@$(CPP) -o $@ $<
   243 	@$(CPP) -o $@ $<
   241 
   244 
   298 .PHONY: beauty clean uninstall
   301 .PHONY: beauty clean uninstall
   299 
   302 
   300 clean:
   303 clean:
   301 	find -name '*~' -exec rm -f {} \;
   304 	find -name '*~' -exec rm -f {} \;
   302 	find -name '*.[oa]' -exec rm -f {} \;
   305 	find -name '*.[oa]' -exec rm -f {} \;
       
   306 	find -name '*.gcov' -exec rm -f {} \;
       
   307 	find -name '*.gcda' -exec rm -f {} \;
       
   308 	find -name '*.gcno' -exec rm -f {} \;
       
   309 	find -name 'gmon.out' -exec rm -f {} \;
   303 	rm -f $(TARGET)
   310 	rm -f $(TARGET)
   304 
   311 
   305 beauty:
   312 beauty:
   306 	find -name '*.[ch]' -exec indent {} \;
   313 	find -name '*.[ch]' -exec indent {} \;
   307 	find -name '*.[ch]' -exec eraser {} \;
   314 	find -name '*.[ch]' -exec eraser {} \;