18 Dec, 2010, phobos wrote in the 1st comment:
Votes: 0
I've got this code to compile to the end of the startup but its giving me this message at the end

./startup: line 44: syntax error: unexpected end of file

Here is the whole startup code

if /bin/csh -f

set port = 1530
if "$1" != "" set port="$1"

cd ../area

nohup
nice
limit stack 1024k
unlimit core
if -e shutdown.txt rm -f shutdown.txt

while 1
set index = 1000
while 1
set logfile = ../log/$index.log
if ! -e $logfile break
@ index++

end


date > $logfile
date > ../area/boot.txt

# Run SWR.
# Check if already running
set matches = `netstat -an | grep ":$port " | grep -c LISTEN`
if $matches >= 1 then
# Already running
echo Port $port is already in use.
exit 0
endif
../bin/swr $port >&! $logfile

if -e shutdown.txt then
rm -f shutdown.txt
exit 0
endif
sleep 10

end
18 Dec, 2010, Remcon wrote in the 2nd comment:
Votes: 0
Open it up and make sure there is a line after the end line, it's been a long time since I seen that error, but think that it is caused when there is no new line after the end
18 Dec, 2010, phobos wrote in the 3rd comment:
Votes: 0
If i put a line in it just moves the error down a line so what dose that mean? Is there an endstatement i need to add?
19 Dec, 2010, ATT_Turan wrote in the 4th comment:
Votes: 0
Are you editing/adding the line in a text editor on your Windows machine before FTP'ing it to the server, or are you using a Linux utility (pico, vi, emacs) to edit the file? Sometimes the latter is necessary to get the server to "like" your file.
19 Dec, 2010, phobos wrote in the 5th comment:
Votes: 0
Havent put it on a server seeing that i just got it and my net is wireless so im always connected…. I'm editing the startup file in Dev-C++ and saving it then trying to compile.

Looking at the errors for ./makefile this is a real common one for me but its on all the lines that have no code totally blank lines

./makefile: line 4: $'\r': command not found
19 Dec, 2010, David Haley wrote in the 6th comment:
Votes: 0
That means you somehow have gotten yourself Windows line endings… you need to convert those to Unix line endings. Try: dos2unix. If that doesn't work, you can find other commands. You can also load in vi, type :set fileformat=unix and then save.

By the way – why exactly does your startup file's shebang line start with an 'if'? Have you changed this file? It should start with a # line, not 'if'…

Also, this is not code to compile, this is a startup script.
19 Dec, 2010, phobos wrote in the 7th comment:
Votes: 0
Ok corrected the first line in startup. When i tried using the dos command it just started to output double on any command i put in.

I'm using Dev-C++ to edit but running with cygwin is that ok?

Should i get rid of Dev and get Vi, Is Vi easy to navigate?
19 Dec, 2010, phobos wrote in the 8th comment:
Votes: 0
I've changed all the files to unix and it did nothing for the startup which makes me come the the conclusion of the makefile needs to be fixed first. Changing all the files over got rid of over a third of the errors from makefile. Am i missing an #include <something> statement? Asking because this is what im left with for errors followed by makefile code

$ ./makefile
./makefile: line 2: PROF: command not found
./makefile: line 3: NOCRYPT: command not found
./makefile: line 6: NEED_DL: command not found
./makefile: line 12: EXPORT_SYMBOLS: command not found
./makefile: line 14: EXPORT_SYMBOLS: command not found
./makefile: line 14: CYGWIN_FLAG: command not found
./makefile: line 14: PROF: command not found
./makefile: line 14: NOCRYPT: command not found
./makefile: line 14: DBUGFLG: command not found
./makefile: line 14: EXPORT_SYMBOLS: command not found
./makefile: line 14: C_FLAGS: command not found
./makefile: line 15: PROF: command not found
./makefile: line 15: EXPORT_SYMBOLS: command not found
./makefile: line 15: CYGWIN_FLAG: command not found
./makefile: line 15: NEED_DL: command not found
./makefile: line 15: L_FLAGS: command not found
./makefile: line 18: USECARGO: command not found
./makefile: line 20: ifdef: command not found
./makefile: line 21: C_FLAGS: command not found
./makefile: line 21: C_FLAGS: command not found
./makefile: line 22: endif: command not found
./makefile: line 25: C_FILES: command not found
./makefile: line 35: C_FILES: command not found
./makefile: line 35: patsubst: command not found
./makefile: line 35: O_FILES: command not found
./makefile: line 37: wildcard: command not found
./makefile: line 37: H_FILES: command not found
./makefile: line 39: SWR: command not found
./makefile: line 40: SWR_OLD: command not found
./makefile: line 41: COPYFILE: command not found
./makefile: line 43: all:: command not found
./makefile: line 44: MAKE: command not found
./makefile: line 44: -s: command not found
./makefile: line 47: ifdef: command not found
./makefile: line 48: -include: command not found
./makefile: line 49: endif: command not found
./makefile: line 51: O_FILES: command not found
./makefile: line 51: swr:: command not found
./makefile: line 52: SWR: command not found
./makefile: line 53: ifdef: command not found
Generating dependency file …
./makefile: line 55: CC: command not found
./makefile: line 55: C_FLAGS: command not found
./makefile: line 55: C_FILES: command not found
./makefile: line 55: -MM: command not found
./makefile: line 56: perl: command not found
./makefile: line 57: syntax error near unexpected token `else'
./makefile: line 57: `else'




#CC      = gcc
PROF =
NOCRYPT =
#Uncomment the line below if you are getting undefined references to dlsym, dlopen, and dlclose.
#Comment it out if you get errors about ldl not being found.
NEED_DL = -ldl

#Uncomment if using CYGWIN to compile with
#CYGWIN_FLAG = -DCYGWIN

#Some systems need this for dynamic linking to work.
EXPORT_SYMBOLS = -export-dynamic

C_FLAGS = -g2 -Wall $(EXPORT_SYMBOLS) $(CYGWIN_FLAG) $(PROF) $(NOCRYPT) $(DBUGFLG) $(EXPORT_SYMBOLS)
L_FLAGS = $(PROF) $(EXPORT_SYMBOLS) $(CYGWIN_FLAG) $(NEED_DL) -lz -g2

#Comment out to disable cargo
USECARGO = 1

ifdef USECARGO
C_FLAGS := $(C_FLAGS) -DUSECARGO
endif


C_FILES = 11.c act_comm.c act_info.c act_move.c act_obj.c act_wiz.c boards.c \
bounty.c build.c changes.c clans.c color.c comm.c comments.c \
const.c copyover.c db.c editor.c fight.c finfo.c force.c \
fskills.c functions.c handler.c hashstr.c hunter.c interp.c keb.c \
magic.c makeobjs.c marriage.c md5.c mccp.c misc.c mud_comm.c \
mud_prog.c newarena.c pfiles.c planets.c player.c renumber.c reset.c \
save.c ships.c shops.c skills.c slay.c slicers.c slotm.c \
space.c special.c swskills.c tables.c tech.c track.c update.c


O_FILES := $(patsubst %.c,o/%.o,$(C_FILES))

H_FILES = $(wildcard *.h)

SWR = swr
SWR_OLD = ../bin/swr_old
COPYFILE = ../bin/cygwin/copyfile

all:
$(MAKE) -s swr

# pull in dependency info for *existing* .o files
ifdef CYGWIN_FLAG
-include dependencies.d
endif

swr: $(O_FILES)
rm -f $(SWR)
ifdef CYGWIN_FLAG
echo "Generating dependency file …";
$(CC) -MM $(C_FLAGS) $(C_FILES) > dependencies.d
perl -pi -e 's.^([a-z]).o/$$1.g' dependencies.d
else
$(CC) -o $(SWR) $(O_FILES) $(L_FLAGS) -lm -lcrypt
endif
echo " ";
echo "Done compiling mud.";
chmod g+w $(SWR)
chmod a+x $(SWR)
chmod g+w $(O_FILES)
ifdef CYGWIN_FLAG
./$(COPYFILE)
endif
mv $(SWR) ../bin

clean:
ifdef CYGWIN_FLAG
rm -f o/*.o ../bin/other/swr.def ../bin/cygwin/swr.exp
chmod g+w $(COPYFILE)
chmod a+x $(COPYFILE)
./$(COPYFILE)
# $(MAKE) all
else
rm -f o/*.o $(SWR_OLD) ../bin/$(SWR) ../bin/${SWR}.exe ../bin/win/swr.def ../bin/cygwin/swr.exp
# $(MAKE) all
endif


purge:
ifdef CYGWIN_FLAG
rm -f o/*.o ../bin/cygwin/swr.def ../bin/cygwin/swr.exp dependencies.d
else
rm -f o/*.o $(SWR_OLD) $(SWR) ../bin/cygwin/swr.def ../bin/cygwin/swr.exp
endif


o/%.o: %.c
# echo " Compiling $@….";
echo " $@";
$(CC) -c $(C_FLAGS) $< -o $@

.c.o: mud.h
$(CC) -c $(C_FLAGS) $<
19 Dec, 2010, David Haley wrote in the 9th comment:
Votes: 0
This thread's question is being answered in the "what all do I need" thread. Please note that it is confusing to have the same questions in several places.
19 Dec, 2010, phobos wrote in the 10th comment:
Votes: 0
how do i stop this thread? They initialy started as different questions but since they were in the same ball park they kinda melted together
19 Dec, 2010, Tyche wrote in the 11th comment:
Votes: 0
if /bin/csh -f

set port = 1530
if "$1" != "" set port="$1"


You changed the first line of the startup script from
#! /bin/csh -f
to
if /bin/csh -f
…after gettiing an error on line 1.
Change it back.

I suspect the error in line 1 was 'command not found', because the csh shell isn't installed.
Install tcsh from cygwin setup.

$ ./makefile
./makefile: line 2: PROF: command not found
./makefile: line 3: NOCRYPT: command not found


Typeing ./makefile executes the makefile as a bash script.
The command is make and it will look for and read the file called makefile.
0.0/11