Makefile
changeset 117 5f3a34ba6489
parent 116 ae784a3a45b1
child 119 305d2ca32936
equal deleted inserted replaced
116:ae784a3a45b1 117:5f3a34ba6489
     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 LDFLAGS = -L/usr/lib
     4      RM = rm -f
     5      RM = rm -f
     5    FIND = find
     6    FIND = find
     6 
     7 
     7 ifeq ("$(PROFILER)", "linux")
     8 ifeq ("$(PROFILER)", "linux")
     8    PROF = -fprofile-arcs -ftest-coverage -pg
     9    PROF = -fprofile-arcs -ftest-coverage -pg
    87 
    88 
    88 all: $(TARGET)
    89 all: $(TARGET)
    89 
    90 
    90 ncurses: ncurses.o
    91 ncurses: ncurses.o
    91 	@echo Linking $< ...
    92 	@echo Linking $< ...
    92 	@$(CC) $(CFLAGS) -lncursesw -o $@ $<
    93 	@$(CC) $(LDFLAGS) -lncursesw -o $@ $<
    93 
    94 
    94 numerierung: numerierung.o
    95 numerierung: numerierung.o
    95 	@echo Linking $< ...
    96 	@echo Linking $< ...
    96 	@$(CC) $(CFLAGS) -o $@ $<
    97 	@$(CC) $(LDFLAGS) -o $@ $<
    97 
    98 
    98 xdemo: xdemo.o
    99 xdemo: xdemo.o
    99 	@echo Linking $< ...
   100 	@echo Linking $< ...
   100 	@$(CC) $(CFLAGS) -lX11 -o $@ $<
   101 	@$(CC) $(LDFLAGS) -lX11 -o $@ $<
   101 
   102 
   102 signals: signals.o
   103 signals: signals.o
   103 	@echo Linking $< ...
   104 	@echo Linking $< ...
   104 	@$(CC) $(CFLAGS) -o $@ $<
   105 	@$(CC) $(LDFLAGS) -o $@ $<
   105 
   106 
   106 tree: tree.o
   107 tree: tree.o
   107 	@echo Linking $< ...
   108 	@echo Linking $< ...
   108 	@$(CC) $(CFLAGS) -o $@ $<
   109 	@$(CC) $(LDFLAGS) -o $@ $<
   109 
   110 
   110 utf8: utf8.o
   111 utf8: utf8.o
   111 	@echo Linking $< ...
   112 	@echo Linking $< ...
   112 	@$(CC) $(CFLAGS) -o $@ $<
   113 	@$(CC) $(LDFLAGS) -o $@ $<
   113 
   114 
   114 file_demo: file_demo.o
   115 file_demo: file_demo.o
   115 	@echo Linking $< ...
   116 	@echo Linking $< ...
   116 	@$(CC) $(CFLAGS) -o $@ $<
   117 	@$(CC) $(LDFLAGS) -o $@ $<
   117 
   118 
   118 testcase: testcase.o
   119 testcase: testcase.o
   119 	@echo Linking $< ...
   120 	@echo Linking $< ...
   120 	@$(CC) $(CFLAGS) -o $@ $<
   121 	@$(CC) $(LDFLAGS) -o $@ $<
   121 
   122 
   122 atoi_print: atoi_print.o
   123 atoi_print: atoi_print.o
   123 	@echo Linking $< ...
   124 	@echo Linking $< ...
   124 	@$(CC) $(CFLAGS) -o $@ $<
   125 	@$(CC) $(LDFLAGS) -o $@ $<
   125 
   126 
   126 data_types: data_types.c
   127 data_types: data_types.c
   127 	@echo Compiling $< ...
   128 	@echo Compiling $< ...
   128 	@$(CC) $(CFLAGS) -std=c99 -o $@ $<
   129 	@$(CC) $(LDFLAGS) -std=c99 -o $@ $<
   129 
   130 
   130 dnsresolve: dnsresolve.o
   131 dnsresolve: dnsresolve.o
   131 	@echo Linking $< ...
   132 	@echo Linking $< ...
   132 	@$(CC) $(CFLAGS) -o $@ $<
   133 	@$(CC) $(LDFLAGS) -o $@ $<
   133 
   134 
   134 nomalloc: nomalloc.o
   135 nomalloc: nomalloc.o
   135 	@echo Linking $< ...
   136 	@echo Linking $< ...
   136 	@$(CC) $(CFLAGS) -o $@ $<
   137 	@$(CC) $(LDFLAGS) -o $@ $<
   137 
   138 
   138 urandom: urandom.o
   139 urandom: urandom.o
   139 	@echo Linking $< ...
   140 	@echo Linking $< ...
   140 	@$(CC) $(CFLAGS) -o $@ $<
   141 	@$(CC) $(LDFLAGS) -o $@ $<
   141 
   142 
   142 threads: threads.o
   143 threads: threads.o
   143 	@echo Linking $< ...
   144 	@echo Linking $< ...
   144 	@$(CC) $(CFLAGS) -o $@ $< -lpthread
   145 	@$(CC) $(LDFLAGS) -o $@ $< -lpthread
   145 
   146 
   146 crypt: crypt.o
   147 crypt: crypt.o
   147 	@echo Linking $< ...
   148 	@echo Linking $< ...
   148 	@$(CC) $(CFLAGS) -o $@ $< -lcrypt
   149 	@$(CC) $(LDFLAGS) -o $@ $< -lcrypt
   149 
   150 
   150 tokenpasting: tokenpasting.o
   151 tokenpasting: tokenpasting.o
   151 	@echo Linking $< ...
   152 	@echo Linking $< ...
   152 	@$(CC) $(CFLAGS) -o $@ $<
   153 	@$(CC) $(LDFLAGS) -o $@ $<
   153 
   154 
   154 hex2chars: hex2chars.o
   155 hex2chars: hex2chars.o
   155 	@echo Linking $< ...
   156 	@echo Linking $< ...
   156 	@$(CC) $(CFLAGS) -o $@ $< -lm
   157 	@$(CC) $(LDFLAGS) -o $@ $< -lm
   157 
   158 
   158 floating: floating.o
   159 floating: floating.o
   159 	@echo Linking $< ...
   160 	@echo Linking $< ...
   160 	@$(CC) $(CFLAGS) -o $@ $< -lm
   161 	@$(CC) $(LDFLAGS) -o $@ $< -lm
   161 
   162 
   162 max: max.o
   163 max: max.o
   163 	@echo Linking $< ...
   164 	@echo Linking $< ...
   164 	@$(CC) $(CFLAGS) -o $@ $<
   165 	@$(CC) $(LDFLAGS) -o $@ $<
   165 
   166 
   166 recording: recording.o
   167 recording: recording.o
   167 	@echo Linking $< ...
   168 	@echo Linking $< ...
   168 	@$(CC) $(CFLAGS) -o $@ $<
   169 	@$(CC) $(LDFLAGS) -o $@ $<
   169 
   170 
   170 endian: endian.o
   171 endian: endian.o
   171 	@echo Linking $< ...
   172 	@echo Linking $< ...
   172 	@$(CC) $(CFLAGS) -o $@ $<
   173 	@$(CC) $(LDFLAGS) -o $@ $<
   173 
   174 
   174 fak: fak.o
   175 fak: fak.o
   175 	@echo Linking $< ...
   176 	@echo Linking $< ...
   176 	@$(CC) $(CFLAGS) -o $@ $<
   177 	@$(CC) $(LDFLAGS) -o $@ $<
   177 
   178 
   178 blackhole: blackhole.c
   179 blackhole: blackhole.c
   179 	@echo Compiling AND Linking $< WITH -O0 ...
   180 	@echo Compiling AND Linking $< WITH -O0 ...
   180 	@$(CC) $(CFLAGS) -O0 -o $@ $<
   181 	@$(CC) $(LDFLAGS) -O0 -o $@ $<
   181 
   182 
   182 folge: folge.o
   183 folge: folge.o
   183 	@echo Linking $< ...
   184 	@echo Linking $< ...
   184 	@$(CC) $(CFLAGS) -o $@ $< -lm
   185 	@$(CC) $(LDFLAGS) -o $@ $< -lm
   185 
   186 
   186 counter: counter.o
   187 counter: counter.o
   187 	@echo Linking $< ...
   188 	@echo Linking $< ...
   188 	@$(CC) $(CFLAGS) -o $@ $<
   189 	@$(CC) $(LDFLAGS) -o $@ $<
   189 
   190 
   190 sudoku: sudoku.o
   191 sudoku: sudoku.o
   191 	@echo Linking $< ...
   192 	@echo Linking $< ...
   192 	@$(CC) $(CFLAGS) -o $@ $<
   193 	@$(CC) $(LDFLAGS) -o $@ $<
   193 
   194 
   194 cunit: cunit.o
   195 cunit: cunit.o
   195 	@echo Linking $< ...
   196 	@echo Linking $< ...
   196 	@$(CC) $(CFLAGS) -o $@ $< -lcunit
   197 	@$(CC) $(LDFLAGS) -o $@ $< -lcunit
   197 
   198 
   198 md5: md5.o
   199 md5: md5.o
   199 	@echo Linking $< ...
   200 	@echo Linking $< ...
   200 	@$(CC) -o $@ $< -lssl
   201 	@$(CC) $(LDFLAGS) -o $@ $< -lssl
   201 
   202 
   202 md5rec: md5rec.o
   203 md5rec: md5rec.o
   203 	@echo Linking $< ...
   204 	@echo Linking $< ...
   204 	@$(CC) -o $@ $< -llsf
   205 	@$(CC) $(LDFLAGS) -o $@ $< -llsf
   205 
   206 
   206 myprintf: myprintf.o
   207 myprintf: myprintf.o
   207 	@echo Linking $< ...
   208 	@echo Linking $< ...
   208 	@$(CC) -o $@ $<
   209 	@$(CC) $(LDFLAGS) -o $@ $<
   209 
   210 
   210 concatenation: concatenation.o
   211 concatenation: concatenation.o
   211 	@echo Linking $< ...
   212 	@echo Linking $< ...
   212 	@$(CC) -o $@ $<
   213 	@$(CC) $(LDFLAGS) -o $@ $<
   213 
   214 
   214 alpha_beta: alpha_beta.o
   215 alpha_beta: alpha_beta.o
   215 	@echo Linking $< ...
   216 	@echo Linking $< ...
   216 	@$(CC) -o $@ $<
   217 	@$(CC) $(LDFLAGS) -o $@ $<
   217 
   218 
   218 life: life.o
   219 life: life.o
   219 	@echo Linking $< ...
   220 	@echo Linking $< ...
   220 	@$(CC) -o $@ $<
   221 	@$(CC) $(LDFLAGS) -o $@ $<
   221 
   222 
   222 bad_alloc: bad_alloc.o
   223 bad_alloc: bad_alloc.o
   223 	@echo Linking $< ...
   224 	@echo Linking $< ...
   224 	@$(CPP) -o $@ $<
   225 	@$(CPP) $(LDFLAGS) -o $@ $<
   225 
   226 
   226 lotto: lotto.o
   227 lotto: lotto.o
   227 	@echo Linking $< ...
   228 	@echo Linking $< ...
   228 	@$(CC) -o $@ $<
   229 	@$(CC) $(LDFLAGS) -o $@ $<
   229 
   230 
   230 mem2swap: mem2swap.o set_limit.o
   231 mem2swap: mem2swap.o set_limit.o
   231 	@echo Linking $< ...
   232 	@echo Linking $< ...
   232 	@$(CC) -o $@ mem2swap.o set_limit.o
   233 	@$(CC) $(LDFLAGS) -o $@ mem2swap.o set_limit.o
   233 
   234 
   234 prog_limit: prog_limit.o set_limit.o
   235 prog_limit: prog_limit.o set_limit.o
   235 	@echo Linking $< ...
   236 	@echo Linking $< ...
   236 	@$(CC) -o $@ prog_limit.o set_limit.o
   237 	@$(CC) $(LDFLAGS) -o $@ prog_limit.o set_limit.o
   237 
   238 
   238 database: database.c
   239 database: database.c
   239 	@echo Compiling $< ...
   240 	@echo Compiling $< ...
   240 	@$(CC) -c -I$(shell pg_config --includedir) $<
   241 	@$(CC) -c -I$(shell pg_config --includedir) $<
   241 	@echo Linking $< ...
   242 	@echo Linking $< ...
   242 	@$(CC) -lpq -o $@ $@.o
   243 	@$(CC) $(LDLAGS) -lpq -o $@ $@.o
   243 
   244 
   244 gauss: gauss.o
   245 gauss: gauss.o
   245 	@echo Linking $< ...
   246 	@echo Linking $< ...
   246 	@$(CC) -o $@ $<
   247 	@$(CC) $(LDFLAGS) -o $@ $<
   247 
   248 
   248 connection: connection.o
   249 connection: connection.o
   249 	@echo Linking $< ...
   250 	@echo Linking $< ...
   250 	@$(CC) -o $@ $<
   251 	@$(CC) $(LDFLAGS) -o $@ $<
   251 
   252 
   252 copy: copy.o
   253 copy: copy.o
   253 	@echo Linking $< ...
   254 	@echo Linking $< ...
   254 	@$(CPP) -o $@ $<
   255 	@$(CPP) $(LDFLAGS) -o $@ $<
   255 
   256 
   256 function_pointers: function_pointers.o
   257 function_pointers: function_pointers.o
   257 	@echo Linking $< ...
   258 	@echo Linking $< ...
   258 	@$(CC) -o $@ $<
   259 	@$(CC) $(LDFLAGS) -o $@ $<
   259 
   260 
   260 sort: sort.o
   261 sort: sort.o
   261 	@echo Linking $< ...
   262 	@echo Linking $< ...
   262 	@$(CC) -o $@ $<
   263 	@$(CC) $(LDFLAGS) -o $@ $<
   263 
   264 
   264 min2time: min2time.o
   265 min2time: min2time.o
   265 	@echo Linking $< ...
   266 	@echo Linking $< ...
   266 	@$(CC) -o $@ $<
   267 	@$(CC) $(LDFLAGS) -o $@ $<
   267 
   268 
   268 recursive_compiler: recursive_compiler.o
   269 recursive_compiler: recursive_compiler.o
   269 	@echo Linking $< ...
   270 	@echo Linking $< ...
   270 	@$(CC) -o $@ $<
   271 	@$(CC) $(LDFLAGS) -o $@ $<
   271 
   272 
   272 getpwnam_error: getpwnam_error.o
   273 getpwnam_error: getpwnam_error.o
   273 	@echo Linking $< ...
   274 	@echo Linking $< ...
   274 	@$(CC) -o $@ $<
   275 	@$(CC) $(LDFLAGS) -o $@ $<
   275 
   276 
   276 xmlparser: xmlparser.o
   277 xmlparser: xmlparser.o
   277 	@echo Linking $< ...
   278 	@echo Linking $< ...
   278 	@$(CC) -o $@ $< -lexpat
   279 	@$(CC) $(LDFLAGS) -o $@ $< -lexpat
   279 
   280 
   280 vector: vector.o
   281 vector: vector.o
   281 	@echo Linking $< ...
   282 	@echo Linking $< ...
   282 	@$(CPP) -o $@ $<
   283 	@$(CPP) $(LDFLAGS) -o $@ $<
   283 
   284 
   284 base10: base10.o
   285 base10: base10.o
   285 	@echo Linking $< ...
   286 	@echo Linking $< ...
   286 	@$(CC) -lm -o $@ $<
   287 	@$(CC) $(LDFLAGS) -lm -o $@ $<
   287 
   288 
   288 files: files.o
   289 files: files.o
   289 	@echo Linking $< ...
   290 	@echo Linking $< ...
   290 	@$(CC) -o $@ $<
   291 	@$(CC) $(LDFLAGS) -o $@ $<
   291 
   292 
   292 fork: fork.o
   293 fork: fork.o
   293 	@echo Linking $< ...
   294 	@echo Linking $< ...
   294 	@$(CC) -o $@ $<
   295 	@$(CC) $(LDFLAGS) -o $@ $<
   295 
   296 
   296 duff: duff.o
   297 duff: duff.o
   297 	@echo Linking $< ...
   298 	@echo Linking $< ...
   298 	@$(CC) -o $@ $<
   299 	@$(CC) $(LDFLAGS) -o $@ $<
   299 
   300 
   300 unicode: unicode.c
   301 unicode: unicode.c
   301 	@echo Linking $<...
   302 	@echo Linking $<...
   302 	@$(CC) $(CFLAGS) -std=c99 -o $@ $<
   303 	@$(CC) $(LDFLAGS) -std=c99 -o $@ $<
   303 
   304 
   304 fts: fts.c
   305 fts: fts.c
   305 	@echo Linking $< ...
   306 	@echo Linking $< ...
   306 	@$(CC) -Wall -O2 $< -o $@
   307 	@$(CC) -Wall -O2 $(LDFLAGS) $< -o $@
   307 
   308 
   308 clplaner: clplaner.o
   309 clplaner: clplaner.o
   309 	@echo Linking $<...
   310 	@echo Linking $<...
   310 	@$(CC) -o $@ $<
   311 	@$(CC) $(LDFLAGS) -o $@ $<
   311 
   312 
   312 daemon: daemon.c
   313 daemon: daemon.c
   313 	@echo Linking $<...
   314 	@echo Linking $<...
   314 	@$(CC) -Wall -O2 -g -ggdb $< -o $@
   315 	@$(CC) -Wall -O2 -g -ggdb $(LDFLAGS) $< -o $@
   315 
   316 
   316 numbers: numbers.o
   317 numbers: numbers.o
   317 	@echo Linking $<...
   318 	@echo Linking $<...
   318 	@$(CC) -Wall -O2 -g -ggdb $< -o $@
   319 	@$(CC) -Wall -O2 -g -ggdb $(LDFLAGS) $< -o $@
   319 
   320 
   320 nearest: nearest.o
   321 nearest: nearest.o
   321 	@echo Linking $<...
   322 	@echo Linking $<...
   322 	@$(CPP) -Wall -O2 -g -ggdb $< -o $@
   323 	@$(CPP) -Wall -O2 -g -ggdb $(LDFLAGS) $< -o $@
   323 
   324 
   324 cppdatabase: cppdatabase.o
   325 cppdatabase: cppdatabase.o
   325 	@echo Linking $<...
   326 	@echo Linking $<...
   326 	@$(CPP) -Wall -O2 -g -ggdb $< -o $@
   327 	@$(CPP) -Wall -O2 -g -ggdb $(LDFLAGS) $< -o $@
   327 
   328 
   328 pipe: pipe.o
   329 pipe: pipe.o
   329 	@echo Linking $<...
   330 	@echo Linking $<...
   330 	@$(CC) -Wall -O2 -g -ggdb $< -o $@
   331 	@$(CC) -Wall -O2 -g -ggdb $(LDFLAGS) $< -o $@
   331 
   332 
   332 compliteral: compliteral.o
   333 compliteral: compliteral.o
   333 	@echo Linking $<...
   334 	@echo Linking $<...
   334 	@$(CC) -Wall -O2 -g -ggdb $< -o $@
   335 	@$(CC) -Wall -O2 -g -ggdb $(LDFLAGS) $< -o $@
   335 
   336 
   336 
   337 
   337 .PHONY: beauty clean uninstall
   338 .PHONY: beauty clean uninstall
   338 
   339 
   339 clean:
   340 clean: