author | ecalot
<ecalot> 2005-06-30 21:26:42 UTC |
committer | ecalot
<ecalot> 2005-06-30 21:26:42 UTC |
parent | c89fcb469e202a5fdb21a091641185280fce1187 |
poprecog/Makefile | +61 | -0 |
poprecog/poprecog.c | +1 | -1 |
diff --git a/poprecog/Makefile b/poprecog/Makefile new file mode 100644 index 0000000..13d928d --- /dev/null +++ b/poprecog/Makefile @@ -0,0 +1,61 @@ +############ +# Programs # +############ + +CC = gcc +LINKER = ld +INFO = @echo +MAKEDIR = @mkdir -p +REMOVER = @rm -f +GZIP = @gzip +COPY = @ln -f + +#################### +# Compiler options # +#################### + +#Libraries: include path and linked libs +INCLUDE = +LIBS = `allegro-config --libs --cflags` + +RELEASE = +#-g -Wall -pedantic +LINKERRELEASE = + +MAIN = .poprecog.o + +EXEOBJ = $(MAIN) + +EXEFILE = poprecog + +#Use this to temporary remove an option +OPTIONS = $(INCLUDE) $(DEFINES) $(RELEASE) +LINKEROPTIONS = $(LINKERRELEASE) $(LIBS) + +#main file + +$(EXEFILE): $(EXEOBJ) + $(INFO) Linking files... + $(CC) $(LINKEROPTIONS) -o $(EXEFILE) $(EXEOBJ) + $(INFO) Program successfully compiled + $(INFO) + $(INFO) Please read readme.txt for syntax information + $(INFO) + +#command options +.PHONY: clean build all lib + +clean: + $(INFO) Erasing temporary object files... + $(REMOVER) $(EXEOBJ) $(EXEFILE) + +build: clean $(EXEFILE) + +all: $(EXEFILE) + +#files + +.poprecog.o: poprecog.c + $(INFO) Compiling poprecog... + $(CC) $(OPTIONS) -c poprecog.c -o $@ + diff --git a/poprecog/poprecog.c b/poprecog/poprecog.c index 4035cde..fb20bc1 100644 --- a/poprecog/poprecog.c +++ b/poprecog/poprecog.c @@ -973,7 +973,7 @@ void sortListOfScreenShots() { if (match("*.bmp", file->d_name) || match("*.BMP", file->d_name)) { - tmpScreenShotsList[tmpScreenShotsNumber] = (char *) malloc(file->d_namlen+1); + tmpScreenShotsList[tmpScreenShotsNumber] = (char *) malloc(strlen(file->d_name)+1); strcpy(tmpScreenShotsList[tmpScreenShotsNumber], file->d_name); tmpScreenShotsNumber++; }