Skip to content

Commit

Permalink
- Update parser makefile
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@6050 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 8, 2010
1 parent da13ec0 commit 1151192
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions Parser/Makefile.common
Expand Up @@ -41,17 +41,52 @@ libomparse.a: parse.o $(OBJS)
ar -ru $@ parse.o $(OBJS)
ranlib $@

ModelicaParser.h ModelicaParser.c: Modelica.g
$(ANTLRCMD) $<
parsergen = ModelicaParser.c ModelicaParser.h
modelica3gen = Modelica_3_Lexer_BaseModelica_Lexer.c Modelica_3_Lexer_BaseModelica_Lexer.h Modelica_3_Lexer.c Modelica_3_Lexer.h
metamodelicagen = MetaModelica_Lexer_BaseModelica_Lexer.c MetaModelica_Lexer_BaseModelica_Lexer.h MetaModelica_Lexer.c MetaModelica_Lexer.h

Modelica_2_Lexer.c Modelica_2_Lexer.h: Modelica_2_Lexer.g
ModelicaParser.stamp: Modelica.g
@rm -f $@.tmp
@touch $@.tmp
@touch $<
$(ANTLRCMD) $<

Modelica_3_Lexer_BaseModelica_Lexer.c Modelica_3_Lexer_BaseModelica_Lexer.h Modelica_3_Lexer.c Modelica_3_Lexer.h: Modelica_3_Lexer.g BaseModelica_Lexer.g
@touch -c $(parsergen)
@mv -f $@.tmp $@
Modelica_3_Lexer.stamp: Modelica_3_Lexer.g BaseModelica_Lexer.g
@rm -f $@.tmp
@touch $@.tmp
@touch $<
$(ANTLRCMD) $<

MetaModelica_Lexer_BaseModelica_Lexer.c MetaModelica_Lexer_BaseModelica_Lexer.h MetaModelica_Lexer.c MetaModelica_Lexer.h: MetaModelica_Lexer.g BaseModelica_Lexer.g
@touch -c $(modelica3gen)
@mv -f $@.tmp $@
MetaModelica_Lexer.stamp: MetaModelica_Lexer.g BaseModelica_Lexer.g
@rm -f $@.tmp
@touch $@.tmp
@touch $<
$(ANTLRCMD) $<
@touch -c $(metamodelicagen)
@mv -f $@.tmp $@

$(parsergen) : ModelicaParser.stamp
## Recover from the removal of $@
@if test -f $@; then :; else \
rm -f $<; \
$(MAKE) $<; \
fi

$(modelica3gen) : Modelica_3_Lexer.stamp
## Recover from the removal of $@
@if test -f $@; then :; else \
rm -f $<; \
$(MAKE) $<; \
fi

$(metamodelicagen) : MetaModelica_Lexer.stamp
## Recover from the removal of $@
@if test -f $@; then :; else \
rm -f $<; \
$(MAKE) $<; \
fi

clean:
rm -f *.o *.a \
Expand Down

0 comments on commit 1151192

Please sign in to comment.