Mercurial > hg > beaglert
comparison Makefile @ 304:d2b7df6b355b prerelease
Added Makefile support for runscreen, runscreenfg, run, runfg
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 27 May 2016 17:49:05 +0100 |
parents | b26e7c61e3b6 |
children | 132fc61893af |
comparison
equal
deleted
inserted
replaced
302:b26e7c61e3b6 | 304:d2b7df6b355b |
---|---|
28 EXAMPLE:=that | 28 EXAMPLE:=that |
29 endif | 29 endif |
30 | 30 |
31 SCREEN_NAME?=BeagleRT | 31 SCREEN_NAME?=BeagleRT |
32 | 32 |
33 #TODO: run these lines only if the command is not syntax or | |
33 $(shell mkdir -p $(PROJECT_DIR)/build) | 34 $(shell mkdir -p $(PROJECT_DIR)/build) |
34 RM := rm -rf | 35 RM := rm -rf |
35 STATIC_LIBS := ./libprussdrv.a ./libNE10.a | 36 STATIC_LIBS := ./libprussdrv.a ./libNE10.a |
36 LIBS := -lrt -lnative -lxenomai -lsndfile | 37 LIBS := -lrt -lnative -lxenomai -lsndfile |
37 | 38 |
168 -@echo ' ' | 169 -@echo ' ' |
169 OUTPUT_FILE="$(PROJECT_DIR)/$(PROJECT)" | 170 OUTPUT_FILE="$(PROJECT_DIR)/$(PROJECT)" |
170 | 171 |
171 $(OUTPUT_FILE): Bela | 172 $(OUTPUT_FILE): Bela |
172 runfg: run | 173 runfg: run |
173 run: $(OUTPUT_FILE) | 174 run: stop $(OUTPUT_FILE) |
174 @echo "Running $(OUTPUT_FILE)" | 175 echo "Running $(OUTPUT_FILE)" |
175 @$(OUTPUT_FILE) | 176 $(OUTPUT_FILE) |
176 | 177 |
177 runscreen: stop $(OUTPUT_FILE) | 178 runscreen: stop $(OUTPUT_FILE) |
178 runscreen: | 179 runscreen: |
179 @echo "Running $(OUTPUT_FILE) in a screen" | 180 echo "Running $(OUTPUT_FILE) in a screen" |
181 screen -S $(SCREEN_NAME) -d -m $(OUTPUT_FILE) | |
182 runscreenfg: | |
183 echo "Running $(OUTPUT_FILE) in a screen" | |
184 screen -S $(SCREEN_NAME) -m $(OUTPUT_FILE) | |
180 | 185 |
181 BELA_AUDIO_THREAD_NAME=beaglert-audio | 186 BELA_AUDIO_THREAD_NAME=beaglert-audio |
182 stop: | 187 stop: |
183 @PID=`grep $(BELA_AUDIO_THREAD_NAME) /proc/xenomai/stat | cut -d " " -f 5 | sed s/\s//g`; if [ -z $$PID ]; then echo "No process to kill"; else echo "Killing old Bela process $$PID"; kill -2 $$PID; fi; screen -X -S $(SCREEN_NAME) quit > /dev/null; exit 0; | 188 @PID=`grep $(BELA_AUDIO_THREAD_NAME) /proc/xenomai/stat | cut -d " " -f 5 | sed s/\s//g`; if [ -z $$PID ]; then echo "No process to kill"; else echo "Killing old Bela process $$PID"; kill -2 $$PID; fi; screen -X -S $(SCREEN_NAME) quit > /dev/null; exit 0; |
184 # Remove only the user-generated objects | 189 # Remove only the user-generated objects |