2012-12-24 18:14:43 +00:00
|
|
|
CONFIG ?= config.default
|
|
|
|
-include $(CONFIG)
|
|
|
|
|
|
|
|
|
2014-09-07 05:40:42 +00:00
|
|
|
BINARY ?= Chocolate-Wolfenstein-3D
|
2012-12-24 18:14:43 +00:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
MANPREFIX ?= $(PREFIX)
|
2014-08-29 17:15:51 +00:00
|
|
|
UNAME := $(shell uname -s)
|
2012-12-24 18:14:43 +00:00
|
|
|
|
|
|
|
INSTALL ?= install
|
|
|
|
INSTALL_PROGRAM ?= $(INSTALL) -m 555 -s
|
|
|
|
INSTALL_MAN ?= $(INSTALL) -m 444
|
|
|
|
INSTALL_DATA ?= $(INSTALL) -m 444
|
|
|
|
|
|
|
|
|
|
|
|
SDL_CONFIG ?= sdl-config
|
|
|
|
CFLAGS_SDL ?= $(shell $(SDL_CONFIG) --cflags)
|
|
|
|
LDFLAGS_SDL ?= $(shell $(SDL_CONFIG) --libs)
|
|
|
|
|
|
|
|
|
|
|
|
CFLAGS += $(CFLAGS_SDL)
|
|
|
|
|
|
|
|
#CFLAGS += -Wall
|
|
|
|
#CFLAGS += -W
|
|
|
|
CFLAGS += -Wpointer-arith
|
|
|
|
CFLAGS += -Wreturn-type
|
|
|
|
CFLAGS += -Wwrite-strings
|
|
|
|
CFLAGS += -Wcast-align
|
2016-03-21 03:56:00 +00:00
|
|
|
CFLAGS += -O0
|
2012-12-24 18:14:43 +00:00
|
|
|
|
|
|
|
CCFLAGS += $(CFLAGS)
|
|
|
|
CCFLAGS += -Werror-implicit-function-declaration
|
|
|
|
CCFLAGS += -Wimplicit-int
|
2016-03-21 04:07:53 +00:00
|
|
|
CCFLAGS += -Wsequence-point -Iinclude -ISDL_mixer -Isdl/include
|
2012-12-24 18:14:43 +00:00
|
|
|
|
|
|
|
CXXFLAGS += $(CFLAGS)
|
|
|
|
|
2015-09-11 00:03:52 +00:00
|
|
|
LDFLAGS += $(LDFLAGS_SDL) -lm
|
2012-12-24 18:14:43 +00:00
|
|
|
|
|
|
|
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
|
2016-03-19 02:20:16 +00:00
|
|
|
SRCS += id_libretro.cpp
|
2012-12-24 18:14:43 +00:00
|
|
|
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
|
2015-09-10 01:47:14 +00:00
|
|
|
SRCS += surface.cpp
|
2015-03-26 12:35:50 +00:00
|
|
|
SRCS += SDL_mixer/mixer.cpp
|
|
|
|
SRCS += SDL_mixer/music.cpp
|
2012-12-24 18:14:43 +00:00
|
|
|
|
2016-03-21 03:56:00 +00:00
|
|
|
SRCS += sdl/SDL_error.cpp \
|
|
|
|
sdl/file/SDL_rwops.cpp \
|
|
|
|
sdl/video/SDL_blit.cpp \
|
|
|
|
sdl/video/SDL_blit_0.cpp \
|
|
|
|
sdl/video/SDL_blit_1.cpp \
|
|
|
|
sdl/video/SDL_blit_A.cpp \
|
|
|
|
sdl/video/SDL_blit_N.cpp \
|
|
|
|
sdl/video/SDL_bmp.cpp \
|
|
|
|
sdl/video/SDL_pixels.cpp \
|
2016-03-23 19:28:11 +00:00
|
|
|
sdl/video/SDL_surface.cpp \
|
|
|
|
sdl/video/SDL_video.cpp
|
2016-03-21 03:56:00 +00:00
|
|
|
|
2012-12-24 18:14:43 +00:00
|
|
|
OBJS = $(filter %.o, $(SRCS:.c=.o) $(SRCS:.cpp=.o))
|
|
|
|
|
|
|
|
.SUFFIXES:
|
2015-03-25 09:00:35 +00:00
|
|
|
.SUFFIXES: .c .cpp .o
|
2012-12-24 18:14:43 +00:00
|
|
|
|
|
|
|
Q ?= @
|
|
|
|
|
|
|
|
all: $(BINARY)
|
|
|
|
|
|
|
|
$(BINARY): $(OBJS)
|
|
|
|
@echo '===> LD $@'
|
2015-09-11 00:03:52 +00:00
|
|
|
$(Q)$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@
|
2012-12-24 18:14:43 +00:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
@echo '===> CC $<'
|
|
|
|
$(Q)$(CC) $(CCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
.cpp.o:
|
|
|
|
@echo '===> CXX $<'
|
|
|
|
$(Q)$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
clean distclean:
|
|
|
|
@echo '===> CLEAN'
|
2015-03-25 08:53:23 +00:00
|
|
|
$(Q)rm -fr $(OBJS) $(BINARY)
|
2012-12-24 18:14:43 +00:00
|
|
|
|
|
|
|
install: $(BINARY)
|
|
|
|
@echo '===> INSTALL'
|
|
|
|
$(Q)$(INSTALL) -d $(PREFIX)/bin
|
|
|
|
$(Q)$(INSTALL_PROGRAM) $(BINARY) $(PREFIX)/bin
|