forked from orangeduck/Corange
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (28 loc) · 900 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
CC=gcc
INCS= -I ./include
C_FILES= $(wildcard src/*.c) $(wildcard src/*/*.c)
PLATFORM = $(shell uname)
ifeq ($(findstring Linux,$(PLATFORM)),Linux)
OUT=libcorange.so
CFLAGS= $(INCS) -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC
LFLAGS= -lGL -lSDLmain -lSDL -shared
OBJ_FILES= $(addprefix obj/,$(notdir $(C_FILES:.c=.o)))
endif
ifeq ($(findstring MINGW,$(PLATFORM)),MINGW)
OUT=corange.dll
CFLAGS= $(INCS) -std=gnu99 -Wall -Werror -Wno-unused -O3 -g
LFLAGS= -g -L ./lib -lmingw32 -lopengl32 -lSDLmain -lSDL -shared
OBJ_FILES= $(addprefix obj/,$(notdir $(C_FILES:.c=.o))) corange.res
endif
$(OUT): $(OBJ_FILES)
$(CC) $(OBJ_FILES) $(LFLAGS) -o $@
obj/%.o: src/%.c obj
$(CC) $< -c $(CFLAGS) -o $@
obj/%.o: src/*/%.c obj
$(CC) $< -c $(CFLAGS) -o $@
obj:
mkdir obj
corange.res: corange.rc
windres $< -O coff -o $@
clean:
rm $(OBJ_FILES)