*** empty log message ***
[libfirm] / ir / Makefile
1 # Hey, emacs, this is a -*- makefile -*-
2 #
3 # Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
4 # All rights reserved.
5 # Author: Goetz Lindenmaier
6 #
7 # Makefile for IR library.
8
9 # This makefile descends to all directories listed in INCLUDES and to
10 # testprograms and calls make with the corresponding target there.
11 # After returning it builds a library out of the firm files.
12 # Further it updates the TAGS file with each recompilation
13
14 SUBDIRS = adt common debug ident ir tr tv
15 INCLUDES = -I../adt -I../common -I../debug -I../ident -I../include \
16            -I../ir -I../tr -I../tv
17 OFILES =
18
19 AR          = ar rcs
20
21 MAKE    = /usr/bin/make -k
22 SHELL   = /bin/sh
23
24 CXX         = gcc
25 CFLAGS      = -pipe -Wall # -ansi -pedantic # -g
26 COPTFLAGS   = -O3 -ffast-math # -fno-caller-saves
27
28 TARGET  = libfirm.a
29
30 .PHONY: default all clean realclean install depend $(TARGET)
31
32 $(TARGET):
33 #       mkdir objects
34         for i in $(SUBDIRS); do $(MAKE) "INCLUDES=$(INCLUDES)" "CXXFLAGS=-g" -C $$i; done
35         $(AR) $(TARGET) objects/*.o
36         mv $(TARGET) ..
37
38 debug:
39         for i in $(SUBDIRS); do $(MAKE) "CFLAGS=$(CFLAGS) -g INCLUDES=$(INCLUDES)" -C $$i; done
40
41 all:    TAGS $(TARGET)
42
43 clean:
44         for i in $(SUBDIRS); do  $(MAKE) -C $$i clean; done
45
46 realclean:
47         for i in $(SUBDIRS); do  $(MAKE) -C $$i realclean; done
48         rm -f $(TARGET) core
49
50 profile:        realclean
51         for i in $(SUBDIRS); do  \
52                         $(MAKE) \
53                         "CXX=$(CXX)" \
54                         "CFLAGS=-g -pg" \
55                         "INCLUDES=$(INCLUDES)" -C $$i; \
56         done
57
58
59 TAGFILES = $(shell find . -name '*.c' -o -name '*.h')
60
61 TAGS:   $(TAGFILES)
62         etags -C $(TAGFILES)