# Unified Makefile for Apple 2 SDL
#
# by James Hammons
-# (C) 2005 Underground Software
-# This software is licensed under the GPL v2
+# (C) 2005-2018 Underground Software
+# This software is licensed under the GPL v3
#
FIND = find
SYSTYPE = __GCCWIN32__
EXESUFFIX = .exe
ICON = obj/icon.o
-SDLLIBTYPE = --libs
+SDLLIBTYPE = --static-libs
MSG = Win32 on MinGW
+EXTRA = -static
# Should catch both 'darwin' and 'darwin7.0'
else ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin"
CPPFLAGS = $(GCC_DEPS) -Wall -Wno-switch -Wno-non-virtual-dtor $(DEFINES) \
-ffast-math $(SDL_CFLAGS) -pg -g
-LDFLAGS =
+LDFLAGS = $(EXTRA)
#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
-LIBS = -L/usr/local/lib -L/usr/lib $(SDL_LIBS) -lstdc++ -lz $(GLLIB) -pg
+#LIBS = -L/usr/local/lib -L/usr/lib $(SDL_LIBS) -lstdc++ -lz $(GLLIB) -pg
+LIBS = $(SDL_LIBS) -lstdc++ -lz -lm $(GLLIB) -pg
#INCS = -I. -I./src -I/usr/local/include -I/usr/include
INCS = -I. -I./src
OBJS = \
- obj/button.o \
obj/diskselector.o \
- obj/diskwindow.o \
- obj/draggablewindow.o \
- obj/draggablewindow2.o \
- obj/element.o \
+ obj/font10pt.o \
+ obj/font12pt.o \
obj/font14pt.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/a2hs-scsi.o \
+ obj/apple2-fw.o \
+ obj/apple2e-enh.o \
+ obj/firmware.o \
+ \
+ obj/apple2-icon-64x64.o \
obj/charset.o \
+ obj/crc32.o \
obj/dis65c02.o \
- obj/firmware.o \
- obj/floppy.o \
+ obj/fileio.o \
+ obj/floppydrive.o \
+ obj/harddrive.o \
obj/log.o \
obj/mmu.o \
+ obj/mockingboard.o \
obj/sdlemu_config.o \
obj/settings.o \
obj/sound.o \
obj/timing.o \
+ obj/v6522via.o \
obj/v65c02.o \
+ obj/vay8910.o \
obj/video.o \
obj/apple2.o \
$(ICON)
-all: checkenv message obj $(TARGET)$(EXESUFFIX)
+all: 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 "$(FINDSDL2)" ""
- @echo
- @echo
- @echo -e "\033[01;33mIt seems that you don't have the SDL 2 development libraries installed. If you"
- @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?
- @false;
-# @break
-# YES! But ignores all the echo's above... :-/
-#$(error SDL2 MISSING)
-
-else
- @echo -e "\033[01;37mOK\033[00m"
+ $(info )
+ $(info It seems that you don't have the SDL 2 development libraries installed. If you)
+ $(info have installed them, make sure that the sdl2-config file is somewhere in your)
+ $(info path and is executable.)
+ $(info )
+ $(error SDL2 MISSING)
endif
message:
obj:
@mkdir obj
-# This is only done for Win32 at the moment...
-
+# Icon creation 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"
@echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
@$(CC) $(CPPFLAGS) $(INCS) -c $< -o $@
+#Firmware compilation...
+obj/%.o: src/firmware/%.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)
+# strip --strip-all $(TARGET)$(EXESUFFIX)
+# upx -9 $(TARGET)$(EXESUFFIX)
statistics:
@echo -n "Lines in source files: "