mirror of
				https://gitlab.com/klmp200/LO27.git
				synced 2025-10-31 03:53:04 +00:00 
			
		
		
		
	Edit makefile to have an external gui lib
This commit is contained in:
		
							
								
								
									
										34
									
								
								LibGui/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								LibGui/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| CC=gcc | ||||
| CFLAGS=-Wall -Werror -pedantic -fpic -g -std=c89 | ||||
|  | ||||
|  | ||||
| LIBSDIR=-L/usr/lib -L../Libs | ||||
| INCLUDEDIR=-I/usr/include -I. -I../LibAutomaton | ||||
|  | ||||
| #Library variables | ||||
| LIBTARGET=libGui.so | ||||
| LIBSOURCE=pixel | ||||
| LIBSOURCECFILE=$(LIBSOURCE:=.c) | ||||
| LIBSOURCEOFILE=$(LIBSOURCE:=.o) | ||||
|  | ||||
| DEPENDENCELIST=libAutomaton.so | ||||
| DEPENDENCENAMELIST=Automaton | ||||
|  | ||||
| EXTLIBS=`sdl2-config --cflags --libs` | ||||
|  | ||||
| #Generating the library binary | ||||
| $(LIBTARGET): $(LIBSOURCEOFILE) | ||||
| 	@echo "\n Generating the library binary" | ||||
| 	$(CC) $(CFLAGS) $(LIBSDIR) $(EXTLIBS) -l$(DEPENDENCENAMELIST) -shared $(LIBSOURCEOFILE) -o ../Libs/$(LIBTARGET) | ||||
|  | ||||
| #Generating object files | ||||
| .c.o: | ||||
| 	@echo "\n Generating " $@ " from " $< | ||||
| 	$(CC) $(CFLAGS) $(INCLUDEDIR) -c -o $@ $< | ||||
|  | ||||
| #Cleaning | ||||
| clean: | ||||
| 	@echo "\n Cleaning" | ||||
| 	rm -rf *.o *.exe *.so | ||||
|  | ||||
|  | ||||
							
								
								
									
										19
									
								
								LibGui/pixel.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								LibGui/pixel.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| /* | ||||
| * @Author: klmp200 | ||||
| * @Date:   2016-12-27 19:59:21 | ||||
| * @Last Modified by:   klmp200 | ||||
| * @Last Modified time: 2016-12-27 20:09:56 | ||||
| */ | ||||
|  | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <SDL2/SDL.h> | ||||
| #include <pixel.h> | ||||
| #include <matrix.h> | ||||
|  | ||||
| void SDL_test(){ | ||||
| 	PIXEL test; | ||||
| 	Matrix gg = CreateMatrix(); | ||||
| 	SetCellValue(gg, 1, 1, true); | ||||
| 	test.color = 1; | ||||
| } | ||||
							
								
								
									
										13
									
								
								LibGui/pixel.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								LibGui/pixel.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| #ifndef PIXEL_H_INCLUDED | ||||
| #define PIXEL_H_INCLUDED | ||||
|  | ||||
| #include <SDL2/SDL.h> | ||||
|  | ||||
| typedef struct { | ||||
| 	SDL_Rect position; | ||||
| 	Uint8 color; | ||||
| } PIXEL; | ||||
|  | ||||
| void SDL_test(); | ||||
|  | ||||
| #endif | ||||
		Reference in New Issue
	
	Block a user