From: John Janus Date: Sat, 16 Sep 2017 22:26:32 +0000 (+0200) Subject: makefile working now plus small stuff X-Git-Url: https://git.johnzone.org/?a=commitdiff_plain;h=15ac3c0f372be1c837a8af8c5d553f0fd2d6fc5a;p=FakeRadio.git makefile working now plus small stuff --- diff --git a/.gitignore b/.gitignore index 7c1e38e..bb00e1e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.o *swp +fakeradio + diff --git a/Makefile b/Makefile index 3669f8c..b7fa73d 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,15 @@ CC = gcc CFLAGS = -std=gnu11 -Wall LDFLAGS = -lpthread -lao -lmpg123 -lwiringPi -fakeradio: main.o mp3player.o +fakeradio : mp3player.o main.o $(CC) $(CFLAGS) -o fakeradio main.o mp3player.o $(LDFLAGS) -main.o: simple_try.c - $(CC) $(CFLAGS) -o main.o simple_try.c $(LDFLAGS) +main.o : simple_try.c + $(CC) $(CFLAGS) -c -o main.o simple_try.c $(LDFLAGS) -mp3player.o: mp3player.h mp3player.c - $(CC) $(CFLAGS) -o mp3player.o mp3player.c $(LDFLAGS) +mp3player.o : mp3player.h mp3player.c + $(CC) $(CFLAGS) -c -o mp3player.o mp3player.c $(LDFLAGS) +.PHONY : clean +clean : + rm main.o mp3player.o fakeradio diff --git a/fakeradio b/fakeradio deleted file mode 100755 index 4e75de1..0000000 Binary files a/fakeradio and /dev/null differ diff --git a/mp3player.c b/mp3player.c index 954f141..5e91ba6 100644 --- a/mp3player.c +++ b/mp3player.c @@ -58,11 +58,3 @@ void* playFunc(void* file) } -/*int main (int argc, char** argv) -{ - pthread_t thread = startPlayThread("platt01.mp3"); - void* status; - pthread_join(thread, status); - //playFunc("platt01.mp3"); -}*/ - diff --git a/simple_try.c b/simple_try.c index ddf1106..00c829a 100644 --- a/simple_try.c +++ b/simple_try.c @@ -91,7 +91,6 @@ int main(void) { pthread_cond_wait(wakeup, mut); if (playThread) { - printf("playing"); pthread_cancel(playThread); } @@ -99,6 +98,7 @@ int main(void) { digitalWrite(PWRLED, HIGH); digitalWrite(CHNL1LED, HIGH); digitalWrite(CHNL2LED, HIGH); + chnl1=true; } else { digitalWrite(PWRLED, LOW); if (chnl1) {