created nodes subdir and moved Node.{h,cc} there

git-svn-id: svn://anubis/jtlc/trunk@11 f5bc74b8-7b62-4e90-9214-7121d538519f
This commit is contained in:
josh 2010-01-13 19:38:31 +00:00
parent 93fe98f7fd
commit 19dd46d14d
6 changed files with 30 additions and 4 deletions

View File

@ -11,7 +11,7 @@ export CXXFLAGS := -Wall -O2
LDFLAGS := -lfl
SUBDIRS := main parser
SUBDIRS := main parser nodes
all: $(TARGET)

View File

@ -1,8 +1,10 @@
#include <stdio.h> /* tmpfile() */
#include <stdlib.h> /* exit() */
#include "parser/parser.h"
#include <vector>
#include "util/refptr.h"
#include "parser/parser.h"
#include "nodes/Node.h"
using namespace std;
int usage();
@ -41,6 +43,7 @@ int main(int argc, char * argv[])
void compile(const char * filename)
{
FILE * out = tmpfile();
parse(filename);
refptr<Node> tree = parse(filename);
// tree->process(out);
fclose(out);
}

23
nodes/Makefile Normal file
View File

@ -0,0 +1,23 @@
OBJS := $(patsubst %.cc,%.o,$(wildcard *.cc))
DEPS := $(OBJS:.o=.dep)
all: $(DEPS) $(OBJS)
%.o: %.cc
$(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) $<
# Make dependency files
%.dep: %.cc
@set -e; rm -f $@; \
$(CXX) -MM $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
clean:
-$(RM) -f *.o *.dep
# Include dependency files
ifndef CLEAN
-include $(DEPS)
endif

View File

@ -3,7 +3,7 @@
#define PARSER_H
#include "util/refptr.h"
#include "parser/Node.h"
#include "nodes/Node.h"
#define YYSTYPE refptr<Node>