Run on windows OR unix
This commit is contained in:
		
							parent
							
								
									0b21febc6b
								
							
						
					
					
						commit
						3d2c6cbddf
					
				
							
								
								
									
										12
									
								
								makefile
								
								
								
								
							
							
						
						
									
										12
									
								
								makefile
								
								
								
								
							| 
						 | 
				
			
			@ -1,7 +1,15 @@
 | 
			
		|||
CC?=gcc
 | 
			
		||||
LD?=ld
 | 
			
		||||
SHROOMSFLAGS=shrooms-vb-core/core/vb.c -I shrooms-vb-core/core
 | 
			
		||||
SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs) -mconsole
 | 
			
		||||
msys_version := $(if $(findstring Msys, $(shell uname -o)),$(word 1, $(subst ., ,$(shell uname -r))),0)
 | 
			
		||||
 | 
			
		||||
ifeq ($(msys_version), 0)
 | 
			
		||||
SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)
 | 
			
		||||
BINLINKFLAGS=-z noexecstack
 | 
			
		||||
else
 | 
			
		||||
SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs) -mwindows -mconsole
 | 
			
		||||
BINLINKFLAGS=
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
.PHONY: clean build
 | 
			
		||||
clean:
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +42,7 @@ output/vb.o: shrooms-vb-core/core/vb.c
 | 
			
		|||
 | 
			
		||||
output/%.o: assets/%.bin
 | 
			
		||||
	@mkdir -p output
 | 
			
		||||
	@$(LD) -r -b binary -o $@ $<
 | 
			
		||||
	@$(LD) -r -b binary $(BINLINKFLAGS) -o $@ $<
 | 
			
		||||
 | 
			
		||||
shrooms-vb: $(OFILES)
 | 
			
		||||
	@$(CC) -o $@ $(OFILES) $(SDL2FLAGS) -flto
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue