]> Shamusworld >> Repos - apple2/blobdiff - Makefile
Fixed misc. bugs preventing certain games from working, added pause mode.
[apple2] / Makefile
index 4e1abb8b6c076674e71b45651f1848d152caafb6..ba62de7876a3a6cf72569082f95a5048cb242248 100755 (executable)
--- a/Makefile
+++ b/Makefile
-#\r
-# Unified Makefile for Apple 2 SDL\r
-#\r
-# by James L. Hammons\r
-# (C) 2005 Underground Software\r
-# This software is licensed under the GPL v2\r
-#\r
-\r
-# Figure out which system we're compiling for, and set the appropriate variables\r
-\r
-ifeq "$(OSTYPE)" "msys"                                                        # Win32\r
-\r
-SYSTYPE    = __GCCWIN32__\r
-EXESUFFIX  = .exe\r
-GLLIB      = -lopengl32\r
-ICON       = obj/icon.o\r
-SDLLIBTYPE = --libs\r
-MSG        = Win32 on MinGW\r
-\r
-else\r
-#ifeq "$(OSTYPE)" "darwin"\r
-ifeq "darwin" "$(findstring darwin,$(OSTYPE))" # Should catch both 'darwin' and 'darwin7.0'\r
-\r
-SYSTYPE    = __GCCUNIX__ -D_OSX_\r
-EXESUFFIX  =\r
-GLLIB      =\r
-ICON       =\r
-SDLLIBTYPE = --static-libs\r
-MSG        = Mac OS X\r
-\r
-else                                                                                   # *nix\r
-\r
-SYSTYPE    = __GCCUNIX__\r
-EXESUFFIX  =\r
-GLLIB      = -lGL\r
-ICON       =\r
-SDLLIBTYPE = --libs\r
-MSG        = generic Unix/Linux\r
-\r
-endif\r
-endif\r
-\r
-CC         = gcc\r
-LD         = gcc\r
-TARGET     = apple2\r
-\r
-# Note that we use optimization level 2 instead of 3--3 doesn't seem to gain much over 2\r
-#CFLAGS   = -MMD -Wall -Wno-switch -O2 -D$(SYSTYPE) -ffast-math -fomit-frame-pointer `sdl-config --cflags`\r
-#CPPFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -O2 -D$(SYSTYPE) \\r
-# No optimization and w/gcov flags, so that we get an accurate picture from gcov\r
-#CFLAGS   = -MMD -Wall -Wno-switch -D$(SYSTYPE) \\r
-#              -ffast-math -fomit-frame-pointer `sdl-config --cflags` -fprofile-arcs -ftest-coverage\r
-#CPPFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -D$(SYSTYPE) \\r
-#              -ffast-math -fomit-frame-pointer `sdl-config --cflags` -fprofile-arcs -ftest-coverage\r
-# No optimization for profiling with gprof...\r
-CFLAGS   = -MMD -Wall -Wno-switch -D$(SYSTYPE) \\r
-               -ffast-math `sdl-config --cflags` -pg -g\r
-CPPFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -D$(SYSTYPE) \\r
-               -ffast-math `sdl-config --cflags` -pg -g\r
-#              -fomit-frame-pointer `sdl-config --cflags` -g\r
-#              -fomit-frame-pointer `sdl-config --cflags` -DLOG_UNMAPPED_MEMORY_ACCESSES\r
-\r
-LDFLAGS =\r
-\r
-#LIBS = -L/usr/local/lib -L/usr/lib `sdl-config $(SDLLIBTYPE)` -lstdc++ -lz $(GLLIB)\r
-# Link in the gcov library (for profiling purposes)\r
-#LIBS = -L/usr/local/lib -L/usr/lib `sdl-config $(SDLLIBTYPE)` -lstdc++ -lz $(GLLIB) -lgcov\r
-# Link in the gprof lib\r
-LIBS = -L/usr/local/lib -L/usr/lib `sdl-config $(SDLLIBTYPE)` -lstdc++ -lz $(GLLIB) -pg\r
-\r
-INCS = -I. -I./src -I/usr/local/include -I/usr/include\r
-\r
-OBJS = \\r
-       obj/button.o          \\r
-       obj/draggablewindow.o \\r
-       obj/draggablewindow2.o \\r
-       obj/element.o         \\r
-       obj/gui.o             \\r
-       obj/guimisc.o         \\r
-       obj/menu.o            \\r
-       obj/textedit.o        \\r
-       obj/window.o          \\r
-                          \\r
-       obj/applevideo.o      \\r
-       obj/ay8910.o          \\r
-       obj/dis65c02.o        \\r
-       obj/floppy.o          \\r
-       obj/log.o             \\r
-       obj/sdlemu_config.o   \\r
-       obj/sdlemu_opengl.o   \\r
-       obj/settings.o        \\r
-       obj/sound.o           \\r
-       obj/timing.o          \\r
-       obj/v65c02.o          \\r
-       obj/video.o           \\r
-       obj/apple2.o          \\r
-       $(ICON)\r
-\r
-all: checkenv message obj $(TARGET)$(EXESUFFIX)\r
-       @echo\r
-       @echo "*** Looks like it compiled OK... Give it a whirl!"\r
-\r
-# Check the compilation environment, barf if not appropriate\r
-\r
-checkenv:\r
-       @echo\r
-       @echo -n "*** Checking compilation environment... "\r
-ifeq "" "$(shell which sdl-config)"\r
-       @echo\r
-       @echo\r
-       @echo "It seems that you don't have the SDL development libraries installed. If you"\r
-       @echo "have installed them, make sure that the sdl-config file is somewhere in your"\r
-       @echo "path and is executable."\r
-       @echo\r
-#Is there a better way to break out of the makefile?\r
-       @break\r
-else\r
-       @echo "OK"\r
-endif\r
-\r
-message:\r
-       @echo\r
-       @echo "*** Building Apple 2 SDL for $(MSG)..."\r
-       @echo\r
-\r
-clean:\r
-       @echo -n "*** Cleaning out the garbage..."\r
-       @rm -rf obj\r
-       @rm -f ./$(TARGET)$(EXESUFFIX)\r
-       @echo "done!"\r
-\r
-obj:\r
-       @mkdir obj\r
-\r
-# This is only done for Win32 at the moment...\r
-\r
-ifneq "" "$(ICON)"\r
-$(ICON): res/$(TARGET).rc res/$(TARGET).ico\r
-       @echo "*** Processing icon..."\r
-       @windres -i res/$(TARGET).rc -o $(ICON) --include-dir=./res\r
-endif\r
-\r
-obj/%.o: src/%.c\r
-       @echo "*** Compiling $<..."\r
-       @$(CC) $(CFLAGS) $(INCS) -c $< -o $@\r
-\r
-obj/%.o: src/%.cpp\r
-       @echo "*** Compiling $<..."\r
-       @$(CC) $(CPPFLAGS) $(INCS) -c $< -o $@\r
-\r
-#GUI compilation...\r
-obj/%.o: src/gui/%.cpp\r
-       @echo "*** Compiling $<..."\r
-       @$(CC) $(CPPFLAGS) $(INCS) -c $< -o $@\r
-\r
-$(TARGET)$(EXESUFFIX): $(OBJS)\r
-       @echo "*** Linking it all together..."\r
-       @$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)\r
-#      strip --strip-all vj$(EXESUFFIX)\r
-#      upx -9 vj$(EXESUFFIX)\r
-\r
-# Pull in dependencies autogenerated by gcc's -MMD switch\r
-# The "-" in front in there just in case they haven't been created yet\r
-\r
--include obj/*.d\r
+#
+# Unified Makefile for Apple 2 SDL
+#
+# by James L. Hammons
+# (C) 2005 Underground Software
+# This software is licensed under the GPL v2
+#
+
+# Figure out which system we're compiling for, and set the appropriate variables
+
+ifeq "$(OSTYPE)" "msys"                                                        # Win32
+
+SYSTYPE    = __GCCWIN32__
+EXESUFFIX  = .exe
+ICON       = obj/icon.o
+SDLLIBTYPE = --libs
+MSG        = Win32 on MinGW
+
+else
+#ifeq "$(OSTYPE)" "darwin"
+ifeq "darwin" "$(findstring darwin,$(OSTYPE))" # Should catch both 'darwin' and 'darwin7.0'
+
+SYSTYPE    = __GCCUNIX__ -D_OSX_
+EXESUFFIX  =
+ICON       =
+SDLLIBTYPE = --static-libs
+MSG        = Mac OS X
+
+else                                                                                   # *nix
+
+SYSTYPE    = __GCCUNIX__
+EXESUFFIX  =
+ICON       =
+SDLLIBTYPE = --libs
+MSG        = generic Unix/Linux
+
+endif
+endif
+
+CC         = gcc
+LD         = gcc
+TARGET     = apple2
+
+# Note that we use optimization level 2 instead of 3--3 doesn't seem to gain much over 2
+#CFLAGS   = -MMD -Wall -Wno-switch -O2 -D$(SYSTYPE) -ffast-math -fomit-frame-pointer `sdl2-config --cflags`
+#CPPFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -O2 -D$(SYSTYPE) \
+# No optimization and w/gcov flags, so that we get an accurate picture from gcov
+#CFLAGS   = -MMD -Wall -Wno-switch -D$(SYSTYPE) \
+#              -ffast-math -fomit-frame-pointer `sdl2-config --cflags` -fprofile-arcs -ftest-coverage
+#CPPFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -D$(SYSTYPE) \
+#              -ffast-math -fomit-frame-pointer `sdl2-config --cflags` -fprofile-arcs -ftest-coverage
+# No optimization for profiling with gprof...
+CFLAGS   = -MMD -Wall -Wno-switch -D$(SYSTYPE) \
+               -ffast-math `sdl2-config --cflags` -pg -g
+CPPFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -D$(SYSTYPE) \
+               -ffast-math `sdl2-config --cflags` -pg -g
+#              -fomit-frame-pointer `sdl2-config --cflags` -g
+#              -fomit-frame-pointer `sdl2-config --cflags` -DLOG_UNMAPPED_MEMORY_ACCESSES
+
+LDFLAGS =
+
+#LIBS = -L/usr/local/lib -L/usr/lib `sdl2-config $(SDLLIBTYPE)` -lstdc++ -lz $(GLLIB)
+# Link in the gcov library (for profiling purposes)
+#LIBS = -L/usr/local/lib -L/usr/lib `sdl2-config $(SDLLIBTYPE)` -lstdc++ -lz $(GLLIB) -lgcov
+# Link in the gprof lib
+LIBS = -L/usr/local/lib -L/usr/lib `sdl2-config $(SDLLIBTYPE)` -lstdc++ -lz $(GLLIB) -pg
+
+INCS = -I. -I./src -I/usr/local/include -I/usr/include
+
+OBJS = \
+       obj/button.o          \
+       obj/diskwindow.o      \
+       obj/draggablewindow.o \
+       obj/draggablewindow2.o \
+       obj/element.o         \
+       obj/gui.o             \
+       obj/guimisc.o         \
+       obj/menu.o            \
+       obj/text.o            \
+       obj/textedit.o        \
+       obj/window.o          \
+                          \
+       obj/applevideo.o      \
+       obj/ay8910.o          \
+       obj/dis65c02.o        \
+       obj/floppy.o          \
+       obj/log.o             \
+       obj/sdlemu_config.o   \
+       obj/settings.o        \
+       obj/sound.o           \
+       obj/timing.o          \
+       obj/v65c02.o          \
+       obj/video.o           \
+       obj/apple2.o          \
+       $(ICON)
+
+all: checkenv message obj $(TARGET)$(EXESUFFIX)
+       @echo
+       @echo -e "\033[01;33m***\033[00;32m Looks like it compiled OK... Give it a whirl!\033[00m"
+
+# Check the compilation environment, barf if not appropriate
+
+checkenv:
+       @echo
+       @echo -en "\033[01;33m***\033[00;32m Checking compilation environment... \033[00m"
+ifeq "" "$(shell which sdl2-config)"
+       @echo
+       @echo
+       @echo -e "\033[01;33mIt seems that you don't have the SDL 2 development libraries installed.
+       @echo -e "have installed them, make sure that the sdl2-config file is somewhere in your"
+       @echo -e "path and is executable.\033[00m"
+       @echo
+#Is there a better way to break out of the makefile?
+       @break
+else
+       @echo -e "\033[01;37mOK\033[00m"
+endif
+
+message:
+       @echo
+       @echo -e "\033[01;33m***\033[00;32m Building Apple2 SDL for $(MSG)...\033[00m"
+       @echo
+
+clean:
+       @echo -en "\033[01;33m***\033[00;32m Cleaning out the garbage...\033[00m"
+       @rm -rf obj
+       @rm -f ./$(TARGET)$(EXESUFFIX)
+       @echo -e "\033[01;37mdone!\033[00m"
+
+obj:
+       @mkdir obj
+
+# This is only done for Win32 at the moment...
+
+ifneq "" "$(ICON)"
+$(ICON): res/$(TARGET).rc res/$(TARGET).ico
+       @echo -e "\033[01;33m***\033[00;32m Processing icon...\033[00m"
+       @windres -i res/$(TARGET).rc -o $(ICON) --include-dir=./res
+endif
+
+obj/%.o: src/%.c
+       @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
+       @$(CC) $(CFLAGS) $(INCS) -c $< -o $@
+
+obj/%.o: src/%.cpp
+       @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
+       @$(CC) $(CPPFLAGS) $(INCS) -c $< -o $@
+
+#GUI compilation...
+obj/%.o: src/gui/%.cpp
+       @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
+       @$(CC) $(CPPFLAGS) $(INCS) -c $< -o $@
+
+$(TARGET)$(EXESUFFIX): $(OBJS)
+       @echo -e "\033[01;33m***\033[00;32m Linking it all together...\033[00m"
+       @$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+#      strip --strip-all vj$(EXESUFFIX)
+#      upx -9 vj$(EXESUFFIX)
+
+# Pull in dependencies autogenerated by gcc's -MMD switch
+# The "-" in front in there just in case they haven't been created yet
+
+-include obj/*.d
+