# Linux makefile for qccx
#
# jan_teubel@gmx.net
# 26th Mar 2000

CXX		= g++
CXXFLAGS	= -Wall -O9

# change this, if you wish that qccx will be installed elsewhere
LOCALDIR	= /usr/local/bin

HEADERS		= cmdlib.h \
		  hash.h \
		  pr_comp.h \
		  qcc.h
SOURCES		= cmdlib.cpp \
		  hash.cpp \
		  pr_comp.cpp \
		  pr_lex.cpp \
		  qcc.cpp
OBJECTS		= cmdlib.o \
		  hash.o \
		  pr_comp.o \
		  pr_lex.o \
		  qcc.o

TARGET		= qccx

.cpp.o:
	$(CXX) -c $(CXXFLAGS) -o $@ $<

all: $(TARGET)
	-strip $(TARGET)

install:
	-cp $(TARGET) $(LOCALDIR)

clean:
	-rm -f $(OBJECTS) $(TARGET)
	-rm -f progs.dat
	-rm -f progdefs.h

# this only works, if qccx is already installed
# "make mod" compiles the "mini" mod, which comes with qccx (full optimization
# is turned on, please refer MANUAL in this directory)
mod:
	qccx /O2

$(TARGET): $(OBJECTS)
	$(CXX) $(CXXFLAGS) $(OBJECTS) -o $(TARGET)
