72 lines
1.8 KiB
Plaintext
72 lines
1.8 KiB
Plaintext
|
#### DamnCute Engine ####
|
||
|
### Makefile for OS X ###
|
||
|
|
||
|
SRC = src/Bullet.cpp \
|
||
|
src/Path.cpp \
|
||
|
src/Background.cpp \
|
||
|
src/Core/Core.cpp \
|
||
|
src/APlayer.cpp \
|
||
|
src/AGame.cpp \
|
||
|
|
||
|
VERSION = 1.0
|
||
|
NAME = libdamncute.1.dylib
|
||
|
DEST = ./build
|
||
|
|
||
|
CXXFLAGS = -Wall -Wextra -ansi -W -O2 -I./include -I./include/damncute -std=c++0x -stdlib=libc++ -mmacosx-version-min=10.7 -g
|
||
|
OBJS = $(SRC:.cpp=.o)
|
||
|
RM = rm -rf
|
||
|
|
||
|
CXX = clang++
|
||
|
LINKER = $(CXX)
|
||
|
|
||
|
### PROJECT ###
|
||
|
|
||
|
define SFML
|
||
|
./libs/libsfml-$(1).2.dylib
|
||
|
endef
|
||
|
|
||
|
LIBSFML = $(call SFML,system) $(call SFML,audio) $(call SFML,graphics) $(call SFML,window)
|
||
|
LDFLAGS = -std=c++0x -stdlib=libc++ -headerpad_max_install_names $(LIBSFML) -dynamiclib -current_version $(VERSION) -compatibility_version $(VERSION)
|
||
|
|
||
|
### BUILD-ONLY ###
|
||
|
|
||
|
define B_SFML
|
||
|
./libs/mac/libsfml-$(1).2.dylib
|
||
|
endef
|
||
|
|
||
|
B_LIBSFML = $(call B_SFML,system) $(call B_SFML,audio) $(call B_SFML,graphics) $(call B_SFML,window)
|
||
|
B_LDFLAGS = -std=c++0x -stdlib=libc++ -headerpad_max_install_names $(B_LIBSFML) -dynamiclib -current_version $(VERSION) -compatibility_version $(VERSION)
|
||
|
|
||
|
STOPCOL = \x1b[0m
|
||
|
GREEN = \x1b[32;01m
|
||
|
|
||
|
all: project
|
||
|
|
||
|
project: $(OBJS)
|
||
|
@rm -rf $(DEST)
|
||
|
@mkdir -p $(DEST)/app
|
||
|
@cp -R include $(DEST)/app
|
||
|
@cp -R libs/mac $(DEST)/app/libs
|
||
|
@cp -R Makefile $(DEST)/app
|
||
|
@cp -R src $(DEST)/app
|
||
|
cd $(DEST)/app && $(LINKER) $(OBJS) $(LDFLAGS) -o libs/$(NAME)
|
||
|
@rm -rf $(DEST)/app/src
|
||
|
@cp -R assets/mac/* $(DEST)/app
|
||
|
@cp -R assets/src $(DEST)/app
|
||
|
@cp -R assets/resources $(DEST)/app
|
||
|
@cd $(DEST) && ln -s app/libs Frameworks
|
||
|
@echo "Sample project created into $(GREEN)$(DEST)/app$(STOPCOL)"
|
||
|
|
||
|
build-only: $(OBJS)
|
||
|
$(LINKER) $(OBJS) $(B_LDFLAGS) -o $(NAME)
|
||
|
@echo "Compiled as $(GREEN)$(NAME)$(STOPCOL)"
|
||
|
|
||
|
clean:
|
||
|
$(RM) $(OBJS) *.swp *~ *#
|
||
|
|
||
|
fclean: clean
|
||
|
$(RM) $(NAME)
|
||
|
$(RM) $(DEST)
|
||
|
|
||
|
.PHONY: all clean fclean re
|