parser/c_compiler/Makefile
author Markus Brökers <mbroeker@largo.homelinux.org>
Mon, 30 Aug 2010 15:21:47 +0200
changeset 146 0ffa20c26b2d
parent 66 2b4f786d9073
permissions -rw-r--r--
gauss.c: set a proper accuracy value: 1E-6

      CC = gcc
      LD = ld
    YACC = bison -v
    FLEX = flex
  CFLAGS = -Wall -O2 -ansi -D_XOPEN_SOURCE=500
 LDFLAGS =
 INCLUDE = -Iinclude

OBJECTS  = main.o
OBJECTS += parser.o
OBJECTS += lexer.o

TARGET=mcc

.SUFFIXES: .c .y .l

.c.o:
	$(CC) -c $(CFLAGS) $(INCLUDE) $(CONFIG) $<

.y.c:
	$(YACC) -d $< -o $@

.l.c:
	$(FLEX) -o $@ $<

all: $(TARGET)


$(TARGET): $(OBJECTS)
	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@

.PHONY: distclean clean indent

clean:
	rm -f *.[oae];
	rm -f *~;

distclean:
	make clean
	rm -f $(TARGET)
	rm -f parser.h
	rm -f parser.output

indent:
	indent *.c *.h
	eraser *.c *.h

install: $(TARGET)
	[[ -x ~/bin/ ]] && cp -f $(TARGET) ~/bin