49 lines
1.2 KiB
Makefile
49 lines
1.2 KiB
Makefile
### Sample DamnCute Engine based app Makefile ###
|
|
|
|
SRC = src/main.cpp \
|
|
src/Game.cpp
|
|
|
|
NAME = sample
|
|
CXXFLAGS = -Wall -Wextra -ansi -W -O2 -std=c++0x -I./include
|
|
CXX = clang++
|
|
OBJS = $(SRC:.cpp=.o)
|
|
LINKER = $(CXX)
|
|
|
|
LIB = ./libs
|
|
|
|
define SFML
|
|
$(LIB)/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 $(LIB)/libdamncute.1.dylib $(LIBSFML) -L$(LIB) -Wl,-rpath $(LIB)
|
|
|
|
all: $(NAME)
|
|
|
|
$(NAME): $(OBJS)
|
|
$(LINKER) $(OBJS) $(LDFLAGS) -o $(NAME)
|
|
|
|
BUNDEST = $(NAME).app/Contents
|
|
STOPCOL = \x1b[0m
|
|
GREEN = \x1b[32;01m
|
|
|
|
bundle: $(NAME)
|
|
@mkdir -p $(BUNDEST)/MacOS $(BUNDEST)/Resources
|
|
@cp -R libs $(BUNDEST)/MacOS
|
|
@mv $(NAME) $(BUNDEST)/MacOS
|
|
@cd $(BUNDEST) && ln -s MacOS/libs Frameworks
|
|
@cd $(BUNDEST) && ln -s MacOS/libs libs
|
|
@cp -R util/Info.plist $(BUNDEST)
|
|
@cp -R util/launcher.sh $(BUNDEST)/MacOS
|
|
@cp -R util/Icon.icns $(BUNDEST)/Resources
|
|
@echo "Your OS X app bundle was created as $(GREEN)$(NAME).app$(STOPCOL)"
|
|
|
|
clean:
|
|
$(RM) $(OBJS) *.swp *~ *#
|
|
|
|
fclean: clean
|
|
@$(RM) -rf $(NAME).app
|
|
$(RM) $(NAME)
|
|
|
|
.PHONY: all clean fclean re
|