127b85086b
- Added sound! - Added Linux makefile - Added _KOLIBRI definition - Removed not working parameters from --help in KolibriOS git-svn-id: svn://kolibrios.org@8645 a494cfbc-eb01-0410-851d-a64ba20cac60
127 lines
2.6 KiB
Makefile
127 lines
2.6 KiB
Makefile
CONFIG ?= config.default
|
|
-include $(CONFIG)
|
|
|
|
|
|
BINARY ?= bin/wolf3d
|
|
PREFIX ?= /usr/local
|
|
MANPREFIX ?= $(PREFIX)/share/man/
|
|
MANPAGE ?= man6/wolf4sdl.6
|
|
DATADIR ?= $(PREFIX)/share/games/wolf3d/
|
|
|
|
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
|
|
|
|
ifdef DATADIR
|
|
CFLAGS += -DDATADIR=\"$(DATADIR)\"
|
|
endif
|
|
|
|
CCFLAGS += $(CFLAGS)
|
|
CCFLAGS += -std=gnu99
|
|
CCFLAGS += -Werror-implicit-function-declaration
|
|
CCFLAGS += -Wimplicit-int
|
|
CCFLAGS += -Wsequence-point
|
|
|
|
CXXFLAGS += $(CFLAGS)
|
|
|
|
LDFLAGS += $(LDFLAGS_SDL)
|
|
|
|
SRCS :=
|
|
SRCS += mame/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_atmos.cpp
|
|
SRCS += wl_cloudsky.cpp
|
|
SRCS += wl_debug.cpp
|
|
SRCS += wl_draw.cpp
|
|
SRCS += wl_floorceiling.cpp
|
|
SRCS += wl_game.cpp
|
|
SRCS += wl_inter.cpp
|
|
SRCS += wl_main.cpp
|
|
SRCS += wl_menu.cpp
|
|
SRCS += wl_parallax.cpp
|
|
SRCS += wl_play.cpp
|
|
SRCS += wl_state.cpp
|
|
SRCS += wl_text.cpp
|
|
|
|
SRCS += SDL_mixer/mixer.c
|
|
SRCS += SDL_mixer/music.c
|
|
SRCS += SDL_mixer/load_aiff.c
|
|
SRCS += SDL_mixer/load_voc.c
|
|
SRCS += SDL_mixer/effects_internal.c
|
|
SRCS += SDL_mixer/effect_position.c
|
|
|
|
|
|
DEPS = $(filter %.d, $(SRCS:.c=.d) $(SRCS:.cpp=.d))
|
|
OBJS = $(filter %.o, $(SRCS:.c=.o) $(SRCS:.cpp=.o))
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .c .cpp .d .o
|
|
|
|
Q ?= @
|
|
|
|
all: $(BINARY)
|
|
|
|
ifndef NO_DEPS
|
|
depend: $(DEPS)
|
|
|
|
ifeq ($(findstring $(MAKECMDGOALS), clean depend Data),)
|
|
-include $(DEPS)
|
|
endif
|
|
endif
|
|
|
|
$(BINARY): $(OBJS)
|
|
@echo '===> LD $@'
|
|
$(Q)$(CXX) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@
|
|
|
|
.c.o:
|
|
@echo '===> CC $<'
|
|
$(Q)$(CC) $(CCFLAGS) -c $< -o $@
|
|
|
|
.cpp.o:
|
|
@echo '===> CXX $<'
|
|
$(Q)$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
|
|
.c.d:
|
|
@echo '===> DEP $<'
|
|
$(Q)$(CC) $(CCFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
|
|
|
|
.cpp.d:
|
|
@echo '===> DEP $<'
|
|
$(Q)$(CXX) $(CXXFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
|
|
|
|
clean distclean:
|
|
@echo '===> CLEAN'
|
|
$(Q)rm -fr $(DEPS) $(OBJS) $(BINARY)
|
|
|
|
install: $(BINARY)
|
|
@echo '===> INSTALL'
|
|
$(Q)$(INSTALL) -d $(PREFIX)/bin
|
|
$(Q)$(INSTALL_PROGRAM) $(BINARY) $(PREFIX)/bin
|
|
$(Q)$(INSTALL_MAN) $(MANPAGE) $(MANPREFIX)/man6
|