############################################################################### # Date: Fri Oct 26 01:41:14 CDT 2007 # Author: John Quigley # Revision: $Id$ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ############################################################################### SHELL = /bin/sh CC = gcc LEX = flex LFLAGS = --nounput YACC = bison YFLAGS = -dy CTAGS = ctags -x > tags DEFS = -DDEBUG_WHITE FLAGS = -O2 -Wall -std=c99 -g CFLAGS = $(FLAGS) $(DEFS) -I. LDLIBS = -lfl -lgc LDFLAGS = $(FLAGS) prefix = /usr/local bindir = $(prefix)/bin .SUFFIXES: .SUFFIXES: .c .o .l .y ##### End of system configuration section. ##### FRONTEND_OBJS = $(addprefix frontend/, parse.o scan.o main.o) FRONTEND_SRCS = $(addprefix frontend/, parse.c scan.c main.c) PARSESCAN_SRCS = $(addprefix frontend/, scan.c scan.h parse.c parse.h) LEXYACC_SRCS = $(addprefix frontend/, scan.l parse.y) CORE_OBJS = $(addprefix core/, util.o hbgc.o object.o boolean.o list.o ast.o \ ) CORE_SRCS = $(addprefix core/, util.c hbgc.c object.c boolean.c list.c ast.c \ ) BINS = white OBJS = $(FRONTEND_OBJS) $(CORE_OBJS) SRCS = $(FRONTEND_SRCS) $(CORE_SRCS) ##### Phony rules .PHONY: all all: white .PHONY: tags tags: $(SRCS) $(CTAGS) $(SRCS) .PHONY: clean clean: rm -rf white rm -rf $(FRONTEND_OBJS) $(PARSESCAN_SRCS) rm -rf $(CORE_OBJS) ##### Producer rules $(BINS): $(OBJS) $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(PARSESCAN_SRCS): $(LEXYACC_SRCS) $(LEX) $(LFLAGS) --outfile=scan.c --header-file=scan.h frontend/scan.l mv -f scan.c frontend mv -f scan.h frontend sed -i '28i#include "frontend/parse.h"' frontend/scan.h $(YACC) $(YFLAGS) -o parse.c frontend/parse.y mv -f parse.c frontend mv -f parse.h frontend # EOF