#include ../Makefile.module

include ../../Makefile.site

include ../../defs/Makefile.syntax

syntax_api.o: syntax_api.c syntax_api.h syntax.h attribute.h class.h \
	      syntax_tab.h attribute_tab.h class_tab.h
	$(CC) $(CFLAGS) -c syntax_api.c

class.o: class.c class.h class_tab.h attribute.h attribute_tab.h
	$(CC) $(CFLAGS) -c class.c

attribute.o: attribute.h attribute_tab.h
	$(CC) $(CFLAGS) -c attribute.c

syntax.o: syntax.h syntax_tab.h
	$(CC) $(CFLAGS) -c syntax.c

class_tab.h: ../../defs/class_tab.h
	ln -s ../../defs/class_tab.h .

attribute_tab.h: ../../defs/attribute_tab.h
	ln -s ../../defs/attribute_tab.h .

syntax_tab.h: ../../defs/syntax_tab.h
	ln -s ../../defs/syntax_tab.h .


test: rpsl_test.c test_syntax.c $(RIPLIBDIR)/librpsl.a
	$(CC) $(CFLAGS) -o rpsl_test rpsl_test.c $(RIPLIBDIR)/librpsl.a $(LFLAGS) $(LIBS)
	$(CC) $(CFLAGS) -o test_syntax test_syntax.c $(RIPLIBDIR)/librpsl.a $(LFLAGS) $(LIBS)

clean:
	$(RM) core *.o $(RIPLIBDIR)/librpsl.a

all: .

