this file is replaced by Makefile.in. this much more conform
[libfirm] / ir / common / Makefile
1 # Hey, emacs, this is a -*- makefile -*-
2 ## Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
3 # All rights reserved.
4 # Author: Goetz Lindenmaier
5 #
6 # Makefile for common
7
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 = common.m firm.m
26 MEMBERS  =  $(DISTRIBMEMBERS) panic.m
27
28 CFILES = $(MEMBERS:.m=.c)
29 CFILES +=  xfprintf.c xfprintf.c xfprintf.c
30
31 HFILES = $(MEMBERS:.m=.h)
32 HFILES +=  tune.h xp_help.h xprintf.h misc.h bool.h
33 HFILES +=  common.h debug.h entity.h gmp.h host.h ident.h irgraph.h \
34            irmode.h irnode.h irop.h irprog.h label.h misc.h obst.h \
35            pset.h set.h tv.h type.h xprintf.h xp_help.h
36
37 DISTRIB = $(DISTRIBMEMBERS:.m=.h)
38 DISTRIB += bool.h
39
40 OFILES = $(MEMBERS:%.m=../objects/%.o)
41 OFILES +=  ../objects/xfprintf.o \
42            ../objects/xgprintf.o \
43            ../objects/xoprintf.o \
44
45 DFILES = $(MEMBERS:.m=.d)
46
47 TARGET = all
48
49 .PHONY: default all clean realclean install depend
50 .SUFFIXES: .d .h .c .o
51 .DEFAULT: $(TARGET)
52 .SILENT: $(DFILES) clean  # hides output
53
54 $(TARGET): $(DFILES) $(OFILES)
55
56 %.d:    %.c
57         $(SHELL) -ec '$(CXX) $(DEPENDFLAGS) $(INCLUDES) $(X_INCLUDES) $< | sed '\''s/\($*\)\.o[ :]*/\.\.\/objects\/\1.o $@ : /g'\'' > $@'
58
59
60 ../objects/%.o:    %.c
61         $(CXX) $(CFLAGS) $(CXXFLAGS) $(COPTFLAGS) $(INCLUDES) $(X_INCLUDES) -c $< -o $@
62
63 lib:
64         cp $(DISTRIB) ../../include
65
66 clean:
67         rm -f $(OFILES) $(DFILES)
68
69 realclean:      clean
70         rm -f $(TARGET) *.flc TAGS \#*
71         rm -rf auto/
72
73 -include $(DFILES)