Added makefile. Fixed char pointer warnings
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -51,3 +51,5 @@ Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
*.mp3
|
||||
/csoundbox
|
||||
|
10
csoundbox.c
10
csoundbox.c
@@ -1,8 +1,15 @@
|
||||
#include <ao/ao.h>
|
||||
#include <mpg123.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define BITS 8
|
||||
|
||||
void exitfunction(void) {
|
||||
|
||||
printf("Exiting csoundbox.\n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
mpg123_handle *mh;
|
||||
@@ -18,6 +25,7 @@ int main(int argc, char *argv[])
|
||||
int channels, encoding;
|
||||
long rate;
|
||||
|
||||
atexit(exitfunction);
|
||||
if(argc < 2)
|
||||
exit(0);
|
||||
|
||||
@@ -43,7 +51,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* decode and play */
|
||||
while (mpg123_read(mh, buffer, buffer_size, &done) == MPG123_OK)
|
||||
ao_play(dev, buffer, done);
|
||||
ao_play(dev, (char *)buffer, done);
|
||||
|
||||
/* clean up */
|
||||
free(buffer);
|
||||
|
20
makefile
Normal file
20
makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
#Infos: http://www.ijon.de/comp/tutorials/makefile.html
|
||||
|
||||
|
||||
VERSION = 1.0
|
||||
CC = cc
|
||||
CFLAGS = -Wall -O3 -DVERSION=\"$(VERSION)\"
|
||||
#LDFLAGS = -lm -lpthread `gtk-config --cflags` `gtk-config --libs` -lgthread
|
||||
LDFLAGS = -lmpg123 -lao
|
||||
|
||||
OBJ = csoundbox.o
|
||||
|
||||
all: $(OBJ)
|
||||
$(CC) $(CFLAGS) -o csoundbox $(OBJ) $(LDFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -r *.o
|
Reference in New Issue
Block a user