capture feature
[censuslogo] / Makefile
index ffa81be..0fc7e97 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,24 @@
-src = $(wildcard src/*.c)
+src = $(src_main) $(filter-out $(wildcard src/main_*.c), $(wildcard src/*.c))
 obj = $(src:.c=.o)
 dep = $(obj:.o=.d)
 bin = censuslogo
 
 sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/')
 
-CFLAGS = -pedantic -Wall -g
-LDFLAGS = $(LDFLAGS_$(sys)) -lm
+CFLAGS = -pedantic -Wall -g -DNOLOAD
+LDFLAGS = $(ldflags_sys) -lm
 
-LDFLAGS_Linux = -lGL -lGLU -lglut
-LDFLAGS_mingw = -lmingw32 -mconsole -lopengl32 -lglu32 -lfreeglut
 
 ifeq ($(sys), mingw)
+       src_main = src/main_w32.c
        obj = $(src:.c=.w32.o)
        bin = censuslogo.exe
+       CFLAGS += -DFREEGLUT_STATIC
+
+       ldflags_sys = -lmingw32 -mconsole -lfreeglut_static -lopengl32 -lglu32 -lgdi32 -lwinmm
+else
+       src_main = src/main_x11.c
+       ldflags_sys = -lGL -lGLU -lX11
 endif
 
 $(bin): $(obj)