Annotation of brogue-ce/Makefile, Revision 1.1
1.1 ! rubenllo 1: include config.mk
! 2:
! 3: cflags := -Isrc/brogue -Isrc/platform -std=c99 \
! 4: -Wall -Wpedantic -Werror=implicit -Wno-parentheses -Wno-unused-result -Wno-format
! 5: libs := -lm
! 6: cppflags := -DDATADIR=$(DATADIR)
! 7:
! 8: sources := $(wildcard src/brogue/*.c) $(addprefix src/platform/,main.c platformdependent.c)
! 9:
! 10: ifeq ($(RELEASE),YES)
! 11: extra_version :=
! 12: else
! 13: extra_version := $(shell bash tools/git-extra-version)
! 14: endif
! 15: cppflags += -DBROGUE_EXTRA_VERSION='"$(extra_version)"'
! 16:
! 17: ifeq ($(TERMINAL),YES)
! 18: sources += $(addprefix src/platform/,curses-platform.c term.c)
! 19: cppflags += -DBROGUE_CURSES
! 20: libs += -lncurses
! 21: endif
! 22:
! 23: ifeq ($(GRAPHICS),YES)
! 24: sources += $(addprefix src/platform/,sdl2-platform.c tiles.c)
! 25: cflags += $(shell $(SDL_CONFIG) --cflags)
! 26: cppflags += -DBROGUE_SDL
! 27: libs += $(shell $(SDL_CONFIG) --libs) -lSDL2_image
! 28: endif
! 29:
! 30: ifeq ($(WEBBROGUE),YES)
! 31: sources += $(addprefix src/platform/,web-platform.c)
! 32: cppflags += -DBROGUE_WEB
! 33: endif
! 34:
! 35: ifeq ($(MAC_APP),YES)
! 36: cppflags += -DSDL_PATHS
! 37: endif
! 38:
! 39: ifeq ($(DEBUG),YES)
! 40: cflags += -g -Og
! 41: cppflags += -DENABLE_PLAYBACK_SWITCH
! 42: else
! 43: cflags += -O2
! 44: endif
! 45:
! 46: objects := $(sources:.c=.o)
! 47:
! 48: .PHONY: clean
! 49:
! 50: %.o: %.c src/brogue/Rogue.h src/brogue/IncludeGlobals.h
! 51: $(CC) $(cppflags) $(CPPFLAGS) $(cflags) $(CFLAGS) -c $< -o $@
! 52:
! 53: bin/brogue: $(objects)
! 54: $(CC) $(cflags) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(libs) $(LDLIBS)
! 55:
! 56: windows/icon.o: windows/icon.rc
! 57: windres $< $@
! 58:
! 59: bin/brogue.exe: $(objects) windows/icon.o
! 60: $(CC) $(cflags) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(libs) $(LDLIBS)
! 61: mt -manifest windows/brogue.exe.manifest '-outputresource:bin/brogue.exe;1'
! 62:
! 63: clean:
! 64: $(RM) src/brogue/*.o src/platform/*.o bin/brogue{,.exe}
! 65:
! 66:
! 67: common-files := README.txt CHANGELOG.txt LICENSE.txt seed-catalog.txt
! 68: common-bin := bin/assets bin/keymap.txt
! 69:
! 70: %.txt: %.md
! 71: cp $< $@
! 72:
! 73: windows.zip: $(common-files) $(common-bin)
! 74: zip -rvl $@ $^ bin/brogue.exe bin/*.dll bin/brogue-cmd.bat
! 75:
! 76: macos.zip: $(common-files)
! 77: chmod +x "Brogue CE.app"/Contents/MacOS/brogue
! 78: zip -rv -ll $@ $^ "Brogue CE.app"
! 79:
! 80: linux.tar.gz: $(common-files) $(common-bin) brogue
! 81: chmod +x bin/brogue
! 82: tar -cavf $@ $^ bin/brogue -C linux make-link-for-desktop.sh
! 83:
! 84:
! 85: # $* is the matched %
! 86: icon_%.png: bin/assets/icon.png
! 87: convert $< -resize $* $@
! 88:
! 89: macos/Brogue.icns: icon_32.png icon_128.png icon_256.png icon_512.png
! 90: png2icns $@ $^
! 91: $(RM) $^
! 92:
! 93: Brogue.app: bin/brogue
! 94: mkdir -p $@/Contents/{MacOS,Resources}
! 95: cp macos/Info.plist $@/Contents
! 96: cp bin/brogue $@/Contents/MacOS
! 97: cp -r macos/Brogue.icns bin/assets $@/Contents/Resources
CVSweb