Subversion Repositories Games.Prince of Persia

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
# Prince of Persia Makefile for macOS
2
 
3
NAME = Prince of Persia
4
CC = clang
5
HFILES = common.h config.h data.h proto.h types.h
2 pmbaty 6
OBJ = main.o data.o seg000.o seg001.o seg002.o seg003.o seg004.o seg005.o seg006.o seg007.o seg008.o seg009.o seqtbl.o replay.o options.o lighting.o screenshot.o
1 pmbaty 7
CFLAGS = -Wall -std=gnu99 -D_GNU_SOURCE=1 -D_THREAD_SAFE -DOSX -O2 -I. -F.
8
LDFLAGS = -lm -framework CoreServices -F. -framework SDL2 -framework SDL2_image -framework SDL2_mixer -rpath @executable_path/../Frameworks
9
 
10
all: $(OBJ)
3 pmbaty 11
	$(CC) -Wall -O2 -c xbrz.cpp
2 pmbaty 12
	$(CC) $(LDFLAGS) -lstdc++ $(OBJ) xbrz.o -o prince
1 pmbaty 13
	test -d "$(NAME).app" || mkdir "$(NAME).app"
14
	test -d "$(NAME).app/Contents" || mkdir "$(NAME).app/Contents"
15
	cp Info.plist "$(NAME).app/Contents"
16
	test -d "$(NAME).app/Contents/MacOS" || mkdir "$(NAME).app/Contents/MacOS"
17
	cp prince "$(NAME).app/Contents/MacOS/$(NAME)"
18
	test -d "$(NAME).app/Contents/Frameworks" || mkdir "$(NAME).app/Contents/Frameworks"
3 pmbaty 19
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework"
1 pmbaty 20
	cp -pPR SDL2.framework "$(NAME).app/Contents/Frameworks"
21
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework/Versions/A/_CodeSignature"
22
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework/Versions/A/Headers"
23
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework/Headers"
3 pmbaty 24
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework"
1 pmbaty 25
	cp -pPR SDL2_image.framework "$(NAME).app/Contents/Frameworks"
26
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Versions/A/_CodeSignature"
27
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Versions/A/Headers"
28
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Headers"
3 pmbaty 29
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework"
1 pmbaty 30
	cp -pPR SDL2_mixer.framework "$(NAME).app/Contents/Frameworks"
31
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/_CodeSignature"
32
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Headers"
33
	rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Headers"
34
	test -d "$(NAME).app/Contents/Resources" || mkdir "$(NAME).app/Contents/Resources"
35
	cp icon.icns "$(NAME).app/Contents/Resources/$(NAME).icns"
36
	cp game.ini "$(NAME).app/Contents/Resources"
37
	cp -r data "$(NAME).app/Contents/Resources"
38
 
39
clean:
40
	rm -f $(OBJ) prince
41
 
42
distclean: clean
43
	rm -rf "$(NAME).app"
44
 
45
%.o: %.c $(HFILES)
46
	$(CC) $(CFLAGS) -c $<
47
 
48
.PHONY: all clean