Rev 1 | Rev 3 | 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) |
||
| 2 | pmbaty | 11 | $(CC) -std=c++11 -Wall -O2 -c xbrz.cpp |
| 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" |
||
| 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" |
||
| 23 | cp -pPR SDL2_image.framework "$(NAME).app/Contents/Frameworks" |
||
| 24 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Versions/A/_CodeSignature" |
||
| 25 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Versions/A/Headers" |
||
| 26 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_image.framework/Headers" |
||
| 27 | cp -pPR SDL2_mixer.framework "$(NAME).app/Contents/Frameworks" |
||
| 28 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/_CodeSignature" |
||
| 29 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Headers" |
||
| 30 | rm -rf "$(NAME).app/Contents/Frameworks/SDL2_mixer.framework/Headers" |
||
| 31 | test -d "$(NAME).app/Contents/Resources" || mkdir "$(NAME).app/Contents/Resources" |
||
| 32 | cp icon.icns "$(NAME).app/Contents/Resources/$(NAME).icns" |
||
| 33 | cp game.ini "$(NAME).app/Contents/Resources" |
||
| 34 | cp -r data "$(NAME).app/Contents/Resources" |
||
| 35 | |||
| 36 | clean: |
||
| 37 | rm -f $(OBJ) prince |
||
| 38 | |||
| 39 | distclean: clean |
||
| 40 | rm -rf "$(NAME).app" |
||
| 41 | |||
| 42 | %.o: %.c $(HFILES) |
||
| 43 | $(CC) $(CFLAGS) -c $< |
||
| 44 | |||
| 45 | .PHONY: all clean |