Rev 2 | Go to most recent revision | Details | 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 |
||
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 hqx.o |
||
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) |
||
11 | $(CC) $(LDFLAGS) $(OBJ) -o prince |
||
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" |
||
18 | cp -pPR SDL2.framework "$(NAME).app/Contents/Frameworks" |
||
19 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework/Versions/A/_CodeSignature" |
||
20 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework/Versions/A/Headers" |
||
21 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2.framework/Headers" |
||
22 | cp -pPR SDL2_image.framework "$(NAME).app/Contents/Frameworks" |
||
23 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Versions/A/_CodeSignature" |
||
24 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Versions/A/Headers" |
||
25 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Headers" |
||
26 | cp -pPR SDL2_mixer.framework "$(NAME).app/Contents/Frameworks" |
||
27 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/_CodeSignature" |
||
28 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Headers" |
||
29 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Headers" |
||
30 | test -d "$(NAME).app/Contents/Resources" || mkdir "$(NAME).app/Contents/Resources" |
||
31 | cp icon.icns "$(NAME).app/Contents/Resources/$(NAME).icns" |
||
32 | cp game.ini "$(NAME).app/Contents/Resources" |
||
33 | cp -r data "$(NAME).app/Contents/Resources" |
||
34 | |||
35 | clean: |
||
36 | rm -f $(OBJ) prince |
||
37 | |||
38 | distclean: clean |
||
39 | rm -rf "$(NAME).app" |
||
40 | |||
41 | %.o: %.c $(HFILES) |
||
42 | $(CC) $(CFLAGS) -c $< |
||
43 | |||
44 | .PHONY: all clean |