parser/c_compiler/Makefile
author Markus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:49:13 +0200
changeset 60 47c13ca8c4d0
parent 37 0fbbe329c3a2
child 66 2b4f786d9073
permissions -rw-r--r--
Memory Management * myprintf.c: Dynamic Memory allocation added * prog_limit: fixed a segfault committer: Markus Bröker <mbroeker@largo.homelinux.org>

CC=gcc
LD=ld
YACC=bison -v
FLEX=flex
CFLAGS=-Wall -O2 -ansi -D_XOPEN_SOURCE=500
LDFLAGS=
INCLUDE=include
OBJECTS=main.o parser.o lexer.o
TARGET=mcc

.SUFFIXES: .c .y .l

.c.o:
	$(CC) -c $(CFLAGS) -I$(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