libretro-wolfenstein3d/Makefile.mingw
shanebeavis d965fa4e50 Updated MinGW Makefile
Generates dependency files.
2014-09-29 16:11:39 +10:00

98 lines
1.8 KiB
Makefile

# Usage: mingw32-make -f Makefile.mingw
# all: builds all
# depend: generates dependency files
# clean: removes object and binary files
# distclean: removes dependency, object and binary files
#CXX = gcc -std=c89
BINARY = Chocolate-Wolfenstein-3D.exe
VPATH = win32
CFLAGS = -Wpointer-arith
CFLAGS += -Wreturn-type
CFLAGS += -Wwrite-strings
CFLAGS += -Wcast-align
#CFLAGS = $(INCLUDE)
CCFLAGS = $(CFLAGS)
CCFLAGS += -std=c++11
CCFLAGS += -Werror-implicit-function-declaration
CCFLAGS += -Wimplicit-int
CCFLAGS += -Wsequence-point
#CCFLAGS = $(INCLUDE)
CXXFLAGS += $(CFLAGS)
#LDFLAGS = -Wall
LDFLAGS += -lmingw32
LDFLAGS += -mwindows
LDFLAGS += -mconsole
LDFLAGS += -static-libgcc
LDFLAGS += -static-libstdc++
#LDFLAGS = $(LIB)
LDFLAGS += -lSDLmain -lSDL -lSDL_mixer -lopengl32
SRCS :=
SRCS += fmopl.cpp
SRCS += id_ca.cpp
SRCS += id_in.cpp
SRCS += id_pm.cpp
SRCS += id_sd.cpp
SRCS += id_us_1.cpp
SRCS += id_vh.cpp
SRCS += id_vl.cpp
SRCS += signon.cpp
SRCS += wl_act1.cpp
SRCS += wl_act2.cpp
SRCS += wl_agent.cpp
SRCS += wl_debug.cpp
SRCS += wl_draw.cpp
SRCS += wl_game.cpp
SRCS += wl_inter.cpp
SRCS += wl_main.cpp
SRCS += wl_menu.cpp
SRCS += wl_play.cpp
SRCS += wl_state.cpp
SRCS += wl_text.cpp
SRCS += crt.cpp
SRCS += sdl_winmain.cpp
DEPS = $(filter %.d, $(SRCS:.c=.d) $(SRCS:.cpp=.d))
OBJS = $(filter %.o, $(SRCS:.c=.o) $(SRCS:.cpp=.o))
.SUFFIXES:
.SUFFIXES: .c .cpp .d .o
REBUILDABLES = $(OBJS) $(BINARY)
.PHONY: all
all: $(BINARY)
echo All done
ifndef NO_DEPS
.PHONY: depend
depend: $(DEPS)
ifeq ($(findstring $(MAKECMDGOALS), clean distclean depend),)
-include $(DEPS)
endif
endif
$(BINARY): $(OBJS)
$(CXX) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@
.cpp.o:
$(CXX) $(CXXFLAGS) -c $< -o $@
.cpp.d:
$(CXX) $(CXXFLAGS) -MM -MF $@ -MT $< -MT $@ -c $<
.PHONY: clean
clean:
del /S $(REBUILDABLES)
.PHONY: distclean
distclean:
del /S $(DEPS) $(REBUILDABLES)