*** empty log message ***
[libfirm] / ir / 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 -- intermediate representation of the program
8
9 CXX         = gcc
10 CFLAGS      = -pipe -Wall # -ansi -pedantic
11 CXXFLAGS    = # -g
12 COPTFLAGS   = -O3
13 LDFLAGS     =
14 DEPENDFLAGS = -M
15 LIBPATH     =
16 LIBS        =
17 X_LIBS      =
18 INCLUDES    = -I../adt -I../common -I../debug -I../ident -I../include \
19               -I../ir -I../tr -I../tv
20 X_INCLUDES  =
21
22 SHELL       = /bin/sh
23 MAKE        = /usr/bin/make
24
25 DISTRIBMEMBERS = ircons.m irdump.m irflag.m irgmod.m irgraph.m irgopt.m \
26            irgwalk.m irmode.m irnode.m irop.m iropt.m irprog.m irvrfy.m
27 MEMBERS = $(DISTRIBMEMBERS)
28
29 CFILES = $(MEMBERS:.m=.c)
30
31 HFILES = $(MEMBERS:.m=.h)
32 HFILES +=  irnode_t.h irgraph_t.h irop_t.h
33 HFILES +=  array.h common.h cookies.h debug.h entity.h gmp.h  \
34            host.h ident.h label.h misc.h obst.h pdeq.h pset.h \
35            set.h tune.h tv.h type.h xprintf.h xp_help.h irnode2.h
36
37 DISTRIB = $(DISTRIBMEMBERS:.m=.h)
38
39 OFILES = $(MEMBERS:%.m=../objects/%.o)
40
41 DFILES = $(MEMBERS:.m=.d)
42
43 TARGET = all
44
45 .PHONY: default all clean realclean install depend
46 .SUFFIXES: .d .h .c .o
47 .DEFAULT: $(TARGET)
48 .SILENT: $(DFILES) clean  # hides output
49
50
51 $(TARGET): $(DFILES) $(OFILES)
52
53 # the preprocessor computes the dependencies and saves them to a file
54 # the sed script adds the path to ../objects and file.d to the dependency.
55 %.d:    %.c
56         $(SHELL) -ec '$(CXX) $(DEPENDFLAGS) $(INCLUDES) $(X_INCLUDES) $< | sed '\''s/\($*\)\.o[ :]*/\.\.\/objects\/\1.o $@ : /g'\'' > $@'
57
58
59 ../objects/%.o: %.c
60         $(CXX) $(CFLAGS) $(CXXFLAGS) $(COPTFLAGS) $(INCLUDES) $(X_INCLUDES) -c $< -o $@
61
62 lib:
63         cp $(DISTRIB) ../../include
64
65 clean:
66         rm -f $(OFILES) $(DFILES)
67
68 realclean:      clean
69         rm -f $(TARGET) *.flc TAGS
70
71 -include $(DFILES)