fix Makefile for windows

This commit is contained in:
Yasuhiro Matsumoto 2015-11-26 23:42:01 +09:00
parent 2495b03b30
commit 7be9ee3448
3 changed files with 24 additions and 3 deletions

View File

@ -9,6 +9,13 @@ CFLAGS = -std=c99
SRC = demo.c ../../zahnrad.c
OBJ = $(SRC:.c=.o)
ifeq ($(OS),Windows_NT)
BIN := $(BIN).exe
LIBS = -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lm -lGLU32 -lGLEW32
else
LIBS = -lSDL2 -lGL -lm -lGLU -lGLEW
endif
# Modes
.PHONY: clang
clang: CC = clang
@ -21,5 +28,5 @@ gcc: $(BIN)
$(BIN):
@mkdir -p bin
rm -f bin/$(BIN) $(OBJS)
$(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) -lSDL2 -lGL -lm -lGLU -lGLEW
$(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) $(LIBS)

View File

@ -17,6 +17,13 @@ CFLAGS += -Wswitch-enum -Winvalid-pch -Wbad-function-cast -fno-omit-frame-pointe
SRC = filex.c ../../zahnrad.c
OBJ = $(SRC:.c=.o)
ifeq ($(OS),Windows_NT)
BIN := $(BIN).exe
LIBS = -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lm -lGLU32 -lGLEW32
else
LIBS = -lSDL2 -lGL -lm -lGLU -lGLEW
endif
# Modes
.PHONY: clang
clang: CC = clang
@ -29,4 +36,4 @@ gcc: $(BIN)
$(BIN):
@mkdir -p bin
rm -f bin/$(BIN) $(OBJS)
$(CC) $(SRC) $(CFLAGS) -D_POSIX_C_SOURCE=200809L -o bin/$(BIN) -lSDL2 -lGL -lm -lGLU -lGLEW
$(CC) $(SRC) $(CFLAGS) -D_POSIX_C_SOURCE=200809L -o bin/$(BIN) $(LIBS)

View File

@ -10,6 +10,13 @@ CFLAGS = -std=c99 -pedantic
SRC = nodedit.c ../../zahnrad.c
OBJ = $(SRC:.c=.o)
ifeq ($(OS),Windows_NT)
BIN := $(BIN).exe
LIBS = -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lm -lGLU32 -lGLEW32
else
LIBS = -lSDL2 -lGL -lm -lGLU -lGLEW
endif
# Modes
.PHONY: clang
clang: CC = clang
@ -22,4 +29,4 @@ gcc: $(BIN)
$(BIN):
@mkdir -p bin
rm -f bin/$(BIN) $(OBJS)
$(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) -lSDL2 -lGL -lm -lGLU -lGLEW
$(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) $(LIBS)