codea: chelper aka 'code helper'
[uebersetzerbau-ss10.git] / codea / Makefile
1 SHELL := bash
2 NAME := codea
3 CFLAGS := -ansi -pedantic -D_GNU_SOURCE
4 OBJS := scanner.o parser.o symtable.o code.o chelper.o
5
6 all: $(NAME)
7
8 $(NAME): $(OBJS)
9         @echo "  LINK    $@"
10         @gcc -o $@ $(OBJS) -lfl
11
12 scanner.c: oxout.l
13         @echo "  FLEX    $<"
14         @flex -o$@ $<
15
16 #dirty deps ;)
17 %.o: %.c parser.h symtable.h chelper.h
18         @echo "  CC      $<"
19         @gcc -c $(CFLAGS) $< #-Wall
20
21 parser.c: oxout.y chelper.h
22         @echo "  YACC    $<"
23         @yacc -t -v -d $< -o $@
24
25 parser.h: parser.c
26
27 oxout.y oxout.l: parser.y scanner.lex
28         @echo "  OX      $^"
29         @ox $^
30
31 %.c: %.bfe chelper.h
32         @echo "  IBURG   $<"
33         @bfe < $< | iburg > $@
34
35 .PHONY: clean
36 clean:
37         rm -f $(NAME) $(OBJS) scanner.c parser.{h,c,output} oxout.{y,l,h} code.c
38
39 1test:
40         @echo "  CC      callingconvention.c"
41         @gcc -c -fomit-frame-pointer -fno-defer-pop testit/callingconvention.c -o testit/callingconvention.o
42         @./testit/test
43
44 2test:
45         /usr/ftp/pub/ublu/test/$(NAME)/test 2>&1