opengl-triangle

Basic application that draws triangle on a window using opengl
Index Commits Files Refs
commit 52f14dd3b8dd21cec519f943e50b43b20a8f4ad7
parent f5c66e8493b7da7ad0feead22efca3524eafba6c
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date:   Sat, 24 Aug 2024 00:13:51 -0300

fix libs flags order

on some devices the compilation failed during the link stage

Diffstat:
MMakefile | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,6 +1,6 @@
 CC := gcc
-CLIBS := `pkg-config --libs glfw3` -lGL
-CFLAGS := # -Wall -Wshadow -pedantic -ansi -std=c99 -O3
+CLIBS := -lglfw -lGL
+CFLAGS := -Wall -Wshadow -ansi -std=c99 -O3
 SRCS := $(wildcard *.c)
 OBJS := $(SRCS:.c=.o)
 
@@ -11,11 +11,11 @@ TARGET := opengl-example
 all: $(TARGET)
 
 $(TARGET): $(OBJS)
-    $(CC) $(CLIBS) $(CFLAGS) -o $@ $^
+    $(CC) $(CFLAGS) $^ -o $@ $(CLIBS) 
     rm -f $(OBJS)
 
 %.o: %.c
-    $(CC) $(CLIBS) $(CFLAGS) -c $< -o $@
+    $(CC) $(CFLAGS) -c $< -o $@ 
 
 clean:
     rm -f $(OBJS)