#!/bin/sh

#Shellscript for generating Makefile

MAKEFILE=Makefile
CAT="cat >> $MAKEFILE << EOF"

rm $MAKEFILE

cat >> $MAKEFILE << EOF
#############################################################################
# Makefile for building: knopf
# Generated by qmake (1.05a) (Qt 3.1.2) on: Tue Oct  7 23:50:55 2003
# Project:  knopf.pro
# Template: app
# Command: $(QMAKE) -o Makefile knopf.pro
#############################################################################

####### Compiler, tools and options

CC       = gcc
CXX      = g++
LEX      = flex
YACC     = yacc
CFLAGS   = -pipe -Wall -W -O2  -DQT_NO_DEBUG
CXXFLAGS = -pipe -Wall -W -O2  -DQT_NO_DEBUG
LEXFLAGS = 
YACCFLAGS= -d
INCPATH  = -I$(QTDIR)/mkspecs/default -I. -I. -I../ckonfig -Ilib -I../log -I$(QTDIR)/include
LINK     = g++
LFLAGS   = 
LIBS     = $(SUBLIBS) -L$(QTDIR)/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
AR       = ar cqs
RANLIB   = 
MOC      = $(QTDIR)/bin/moc
UIC      = $(QTDIR)/bin/uic
QMAKE    = qmake
TAR      = tar -cf
GZIP     = gzip -9f
COPY     = cp -f
COPY_FILE= $(COPY) -p
COPY_DIR = $(COPY) -pR
DEL_FILE = rm -f
SYMLINK  = ln -sf
DEL_DIR  = rmdir
MOVE     = mv -f
CHK_DIR_EXISTS= test -d
MKDIR    = mkdir -p

LIBS     = $(SUBLIBS) -L$(QTDIR)/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
AR       = ar cqs
RANLIB   = 
MOC      = $(QTDIR)/bin/moc
UIC      = $(QTDIR)/bin/uic
QMAKE    = qmake
TAR      = tar -cf
GZIP     = gzip -9f
COPY     = cp -f
COPY_FILE= $(COPY) -p
COPY_DIR = $(COPY) -pR
DEL_FILE = rm -f
SYMLINK  = ln -sf
DEL_DIR  = rmdir
MOVE     = mv -f
CHK_DIR_EXISTS= test -d
MKDIR    = mkdir -p

####### Output directory

OBJECTS_DIR = ./

####### Files


HEADERS = \
EOF

find . *.h *.hpp >> $MAKEFILE

cat >> $MAKEFILE << EOF

SOURCES = \
EOF

find . *.c *.cpp >> $MAKEFILE


cat >> $MAKEFILE << EOF

OBJECTS = \
EOF

#TODO: OBJECTS!!!
#board.o \
#		field.o \
#		main.o \
#		ckonfig.o \
#		log.o

cat >> $MAKEFILE << EOF
FORMS = 
UICDECLS = 
UICIMPLS = 
SRCMOC   =
OBJMOC =
DIST	  =
QMAKE_TARGET =
DESTDIR  = 
TARGET   =

first: all
####### Implicit rules

.SUFFIXES: .c .cpp .cc .cxx .C

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

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

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

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

.c.o:
	$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

####### Build rules

all: Makefile $(TARGET)

$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC) 
	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)

mocables: $(SRCMOC)

$(MOC): 
	( cd $(QTDIR)/src/moc ; $(MAKE) )


dist: 
	@mkdir -p .tmp/dist && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/dist/ && ( cd `dirname .tmp/dist` && $(TAR) dist.tar dist && $(GZIP) dist.tar ) && $(MOVE) `dirname .tmp/dist`/dist.tar.gz . && $(DEL_FILE) -r .tmp/dist

mocclean:
	-$(DEL_FILE) $(OBJMOC)
	-$(DEL_FILE) $(SRCMOC)

uiclean:

yaccclean:
lexclean:
clean: mocclean
	-$(DEL_FILE) $(OBJECTS) 
	-$(DEL_FILE) *~ core *.core


####### Sub-libraries

distclean: clean
	-$(DEL_FILE) $(TARGET) $(TARGET)


FORCE:

####### Compile
EOF

#board.o: board.cpp
#
#ckonfig.o: ckonfig/ckonfig.cpp ckonfig/ckonfig.h
#	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o ckonfig.o ckonfig/ckonfig.cpp
#
#moc_board.cpp: $(MOC) board.h
#	$(MOC) board.h -o moc_board.cpp
#
#cat >> $MAKEFILE << EOF

####### Install

install: all 

uninstall: 
EOF

exit 0
Fr Jul 30 13:54:24 CEST 2021
patent_button.gif valid-html401.png elektra.jpg fsfe-logo.png valid-css.png vim.gif anybrowser.gif