#YACCFLAGS += -d -t
YFLAGS += -d -t
+SUBDIRS =
+
+CFLAGS += -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations
INCLUDES = @GLIB_CFLAGS@ -I$(includedir)
-bin_PROGRAMS = gob
+bin_PROGRAMS = @DOINSTGOB@
+noinst_PROGRAMS = @NOINSTGOB@
+EXTRA_PROGRAMS = gob2
+
+BUILT_SOURCES = parse.h parse.c lexer.c
-gob_SOURCES = \
+gob2_SOURCES = \
main.c \
- tree.c \
- tree.h \
+ main.h \
+ treefuncs.c \
+ treefuncs.h \
out.c \
out.h \
+ util.c \
+ util.h \
+ checks.c \
+ checks.h \
parse.y \
lexer.l
-gob_LDADD = \
+gob2_LDADD = \
-lm \
- -lpopt \
$(GLIB_LIBS) \
@LEXLIB@
-BUILT_SOURCES = parse.h parse.c lexer.c
+# we might want popt back in the future
+# @POPT_LIB@
-CLEANFILES += $(BUILT_SOURCES)
+CLEANFILES += $(BUILT_SOURCES) test-object.* test-object-private.h
-EXTRA_DIST = test.gob
+EXTRA_DIST = $(BUILT_SOURCES) test.gob generate_treefuncs.pl treefuncs.def
-parse.h: parse.y
+parse.h parse.c: parse.y
$(YACC) $(YFLAGS) $<
test -f y.tab.c && mv -f y.tab.c parse.c
test -f y.tab.h && mv -f y.tab.h parse.h
-test: gtk-weird-button.c gtk-weird-button.h
-gtk-weird-button.c gtk-weird-button.h: test.gob gob
- ./gob test.gob
+test: test-object.c test-object.h
+ $(CC) -g -Wall `pkg-config --cflags gobject-2.0` -c test-object.c
+
+test-object.c test-object.h: test.gob gob2
+ ./gob2 test.gob
+
+# can't depend on the header file as that would break the above rule
+# since it's just for testing, who cares
+testcpp: test-object.cc
+ g++ -g -Wall `pkg-config --cflags gobject-2.0` -c test-object.cc
+
+test-object.cc: test.gob gob2
+ ./gob2 --for-cpp test.gob