| 1 | #\r |
| 2 | # Makefile for Virtual Jaguar core library\r |
| 3 | #\r |
| 4 | # by James Hammons\r |
| 5 | # Edited by Jean-Paul Mari\r |
| 6 | #\r |
| 7 | # This software is licensed under the GPL v3 or any later version. See the\r |
| 8 | # file LICENSE file for details. ;-)\r |
| 9 | #\r |
| 10 | \r |
| 11 | ifeq ("$(V)","1")\r |
| 12 | Q :=\r |
| 13 | else\r |
| 14 | Q := @\r |
| 15 | endif\r |
| 16 | \r |
| 17 | # Cross compilation with MXE\r |
| 18 | #CROSS = i686-pc-mingw32-\r |
| 19 | \r |
| 20 | SYSTYPE := __GCCUNIX__\r |
| 21 | \r |
| 22 | ifneq "$(CROSS)" ""\r |
| 23 | SYSTYPE := __GCCWIN32__\r |
| 24 | else\r |
| 25 | OSTYPE := $(shell uname -o)\r |
| 26 | ifeq "$(OSTYPE)" "Msys"\r |
| 27 | SYSTYPE := __GCCWIN32__\r |
| 28 | endif\r |
| 29 | endif\r |
| 30 | \r |
| 31 | # Set vars for libcdio\r |
| 32 | ifneq "$(shell pkg-config --silence-errors --libs libcdio)" ""\r |
| 33 | HAVECDIO := -DHAVE_LIB_CDIO\r |
| 34 | CDIOLIB := -lcdio\r |
| 35 | else\r |
| 36 | HAVECDIO :=\r |
| 37 | CDIOLIB :=\r |
| 38 | endif\r |
| 39 | \r |
| 40 | CC := $(CROSS)gcc\r |
| 41 | LD := $(CROSS)gcc\r |
| 42 | AR := $(CROSS)ar\r |
| 43 | ARFLAGS := -rs\r |
| 44 | \r |
| 45 | SDL_CFLAGS = `$(CROSS)sdl-config --cflags`\r |
| 46 | DEFINES = -D$(SYSTYPE)\r |
| 47 | GCC_DEPS = -MMD\r |
| 48 | \r |
| 49 | INCS := -I./src\r |
| 50 | \r |
| 51 | OBJS := \\r |
| 52 | obj/blitter.o \\r |
| 53 | obj/cdintf.o \\r |
| 54 | obj/cdrom.o \\r |
| 55 | obj/dac.o \\r |
| 56 | obj/dsp.o \\r |
| 57 | obj/eeprom.o \\r |
| 58 | obj/event.o \\r |
| 59 | obj/filedb.o \\r |
| 60 | obj/gpu.o \\r |
| 61 | obj/jagbios.o \\r |
| 62 | obj/jagbios2.o \\r |
| 63 | obj/jagcdbios.o \\r |
| 64 | obj/jagdevcdbios.o \\r |
| 65 | obj/jagstub1bios.o \\r |
| 66 | obj/jagstub2bios.o \\r |
| 67 | obj/jagdasm.o \\r |
| 68 | obj/jaguar.o \\r |
| 69 | obj/jerry.o \\r |
| 70 | obj/joystick.o \\r |
| 71 | obj/memory.o \\r |
| 72 | obj/memtrack.o \\r |
| 73 | obj/mmu.o \\r |
| 74 | obj/op.o \\r |
| 75 | obj/state.o \\r |
| 76 | obj/tom.o \\r |
| 77 | obj/universalhdr.o \\r |
| 78 | obj/wavetable.o\r |
| 79 | \r |
| 80 | # Targets for convenience sake, not "real" targets\r |
| 81 | .PHONY: clean\r |
| 82 | \r |
| 83 | all: obj obj/libjaguarcore.a\r |
| 84 | @echo "Done!"\r |
| 85 | \r |
| 86 | obj:\r |
| 87 | @mkdir obj\r |
| 88 | \r |
| 89 | # Library rules (might not be cross-platform compatible)\r |
| 90 | obj/libjaguarcore.a: $(OBJS) \r |
| 91 | $(Q)$(AR) $(ARFLAGS) obj/libjaguarcore.a $(OBJS)\r |
| 92 | \r |
| 93 | # Main source compilation (implicit rules)...\r |
| 94 | \r |
| 95 | obj/%.o: src/%.cpp\r |
| 96 | @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"\r |
| 97 | $(Q)$(CC) $(GCC_DEPS) $(CXXFLAGS) $(SDL_CFLAGS) $(DEFINES) $(INCS) -c $< -o $@\r |
| 98 | \r |
| 99 | -include obj/*.d\r |