Rev 3 | 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 |
||
5 | 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 xbrz.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) |
||
5 | pmbaty | 11 | $(CC) $(LDFLAGS) -lstdc++ $(OBJ) -o prince |
1 | pmbaty | 12 | test -d "$(NAME).app" || mkdir "$(NAME).app" |
13 | test -d "$(NAME).app/Contents" || mkdir "$(NAME).app/Contents" |
||
14 | cp Info.plist "$(NAME).app/Contents" |
||
15 | test -d "$(NAME).app/Contents/MacOS" || mkdir "$(NAME).app/Contents/MacOS" |
||
16 | cp prince "$(NAME).app/Contents/MacOS/$(NAME)" |
||
17 | test -d "$(NAME).app/Contents/Frameworks" || mkdir "$(NAME).app/Contents/Frameworks" |
||
3 | pmbaty | 18 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework" |
1 | pmbaty | 19 | cp -pPR SDL2.framework "$(NAME).app/Contents/Frameworks" |
20 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework/Versions/A/_CodeSignature" |
||
21 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework/Versions/A/Headers" |
||
22 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework/Headers" |
||
3 | pmbaty | 23 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework" |
1 | pmbaty | 24 | cp -pPR SDL2_image.framework "$(NAME).app/Contents/Frameworks" |
25 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Versions/A/_CodeSignature" |
||
26 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Versions/A/Headers" |
||
27 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Headers" |
||
3 | pmbaty | 28 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework" |
1 | pmbaty | 29 | cp -pPR SDL2_mixer.framework "$(NAME).app/Contents/Frameworks" |
30 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/_CodeSignature" |
||
31 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Headers" |
||
32 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Headers" |
||
33 | test -d "$(NAME).app/Contents/Resources" || mkdir "$(NAME).app/Contents/Resources" |
||
34 | cp icon.icns "$(NAME).app/Contents/Resources/$(NAME).icns" |
||
35 | cp game.ini "$(NAME).app/Contents/Resources" |
||
36 | cp -r data "$(NAME).app/Contents/Resources" |
||
37 | |||
38 | clean: |
||
39 | rm -f $(OBJ) prince |
||
40 | |||
41 | distclean: clean |
||
42 | rm -rf "$(NAME).app" |
||
43 | |||
44 | %.o: %.c $(HFILES) |
||
45 | $(CC) $(CFLAGS) -c $< |
||
46 | |||
47 | .PHONY: all clean |