Initial revision
[libfirm] / ir / adt / 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 adt -- abstract data types
7
8 CXX         = gcc
9 CFLAGS      = -pipe -Wall # -ansi -pedantic
10 CXXFLAGS    = # -g
11 COPTFLAGS   = -O3
12 LDFLAGS     =
13 DEPENDFLAGS = -M
14 LIBPATH     =
15 LIBS        =
16 X_LIBS      =
17 INCLUDES    = -I../adt -I../common -I../debug
18 X_INCLUDES  =
19
20 SHELL       = /bin/sh
21 MAKE        = /usr/bin/make
22
23 MEMBERS  = array.m pdeq.m set.m
24
25 CFILES = $(MEMBERS:.m=.c)
26 CFIMES +=  xmalloc.c
27
28 HFILES = $(MEMBERS:.m=.h)
29 HFILES +=  cookies.h host.h obst.h pset.h
30 HFILES +=  misc.h tune.h debug.h
31
32 OFILES = $(MEMBERS:%.m=../objects/%.o)
33 OFILES += ../objects/xmalloc.o ../objects/pset.o
34
35 DFILES = $(MEMBERS:.m=.d)
36
37 TARGET = all
38
39 .PHONY: default all clean realclean install depend
40 .SUFFIXES: .d .h .c .o
41 .DEFAULT: $(TARGET)
42 .SILENT: $(DFILES) clean  # hides output
43
44 $(TARGET): $(DFILES) $(OFILES)
45
46 %.d:    %.c
47         $(SHELL) -ec '$(CXX) $(DEPENDFLAGS) $(INCLUDES) $(X_INCLUDES) $< | sed '\''s/\($*\)\.o[ :]*/\.\.\/objects\/\1.o $@ : /g'\'' > $@'
48
49
50 ../objects/%.o:    %.c
51         $(CXX) $(CFLAGS) $(CXXFLAGS) $(COPTFLAGS) $(INCLUDES) $(X_INCLUDES) -c $< -o $@
52
53 # a hack to force recompilation
54 ../objects/pset.o : set.c pset.h ../objects/set.o
55         $(COMPILE.c) $(INCLUDES) -DPSET -o $@ $<
56 #       $(CXX) $(CFLAGS) $(CXXFLAGS) $(COPTFLAGS) $(INCLUDES) $(X_INCLUDES) -c $< -o $@
57
58 clean:
59         rm -f $(OFILES) $(DFILES)
60
61 realclean:      clean
62         rm -f $(TARGET) *.flc TAGS
63
64
65 -include $(DFILES)