Reviewing compilation and linking of libs
This commit is contained in:
parent
181303a362
commit
e214539fe0
12
Makefile
12
Makefile
@ -1,8 +1,8 @@
|
||||
P=main
|
||||
OBJECTS=libs/glad/glad.o
|
||||
OBJECTS=objs/glad.o objs/stb_image_precompiled.o
|
||||
CFLAGS=-g -Wall -Wextra -O0
|
||||
LDLIBS=-lglfw -lOpenGL -lm
|
||||
INCLUDES=-Ilibs/glad/include/ -Ilibs/
|
||||
LDLIBS=-lglfw -lOpenGL -lm -L objs/libcglm.so
|
||||
INCLUDES=-Ilibs/glad/include/ -Ilibs/ -Iobjs/
|
||||
CC=gcc
|
||||
RM=rm -vf
|
||||
|
||||
@ -10,9 +10,9 @@ RM=rm -vf
|
||||
build: clean
|
||||
$(CC) $(CFLAGS) $(LDLIBS) $(INCLUDES) $(OBJECTS) $(P).c -o $(P)
|
||||
|
||||
.PHONY: all
|
||||
headers: clean
|
||||
$(CC) $(CFLAGS) $(LDLIBS) $(INCLUDES) $(OBJECTS) all.h -o all.h.gch
|
||||
.PHONY: texturepacker
|
||||
texturepacker:
|
||||
$(CC) $(CFLAGS) $(LDLIBS) $(INCLUDES) $(OBJECTS) tools/texturepacker.c -o texturepacker
|
||||
|
||||
.PHONY: run
|
||||
run: build
|
||||
|
14
lib.h
14
lib.h
@ -1,6 +1,20 @@
|
||||
#pragma once
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint8_t u8;
|
||||
// typedef char16_t c16;
|
||||
typedef int32_t b32;
|
||||
typedef int32_t i32;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
typedef float f32;
|
||||
typedef double f64;
|
||||
typedef uintptr_t uptr;
|
||||
typedef char byte;
|
||||
typedef ptrdiff_t size;
|
||||
typedef size_t usize;
|
||||
|
||||
void checkCode(int code, char* errorMsg) {
|
||||
if (code < 0) {
|
||||
|
5
libs/stb_image/stb_image_precompiled.c
Normal file
5
libs/stb_image/stb_image_precompiled.c
Normal file
@ -0,0 +1,5 @@
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#define STBI_FAILURE_USERMSG
|
||||
#include "stb_image.h"
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
#include "stb_image_write.h"
|
2
main.c
2
main.c
@ -5,8 +5,6 @@
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "cglm/cglm.h"
|
||||
#include "lib.h"
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
|
||||
#define PI 3.14159f
|
||||
|
BIN
objs/stb_image_precompiled.o
Normal file
BIN
objs/stb_image_precompiled.o
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user