--- hatari/src/Makefile 2019/04/01 07:12:04 1.1.1.10 +++ hatari/src/Makefile 2019/04/01 07:13:27 1.1.1.13 @@ -1,40 +1,58 @@ # Main Makefile for Hatari. +# Set ENABLE_DSP_EMU to 1 to enable experimental DSP emulation code +# (there are currently no known programs which this would help, +# but it will make many of the Falcon programs not to work). +# If you change this, do "make clean" +ENABLE_DSP_EMU = 0 + +# Select CPU directory: +CPUDIR = uae-cpu + # Include settings include ../Makefile.cnf # Additional include directories: -INCFLAGS = -I./includes -I./uae-cpu - +CPPFLAGS += -I.. -I./includes -I$(CPUDIR) -I./falcon +CPPFLAGS += -DCONFDIR=\"$(CONFDIR)\" $(SDL_CFLAGS) -CFLAGS += -DDATADIR=\"$(DATADIR)\" -DCONFDIR=\"$(CONFDIR)\" $(INCFLAGS) $(SDL_CFLAGS) - - -CPUOBJS = ./uae-cpu/hatari-glue.o ./uae-cpu/memory.o ./uae-cpu/newcpu.o \ - ./uae-cpu/readcpu.o ./uae-cpu/fpp.o ./uae-cpu/cpustbl.o ./uae-cpu/cpudefs.o \ - ./uae-cpu/cpuemu1.o ./uae-cpu/cpuemu2.o ./uae-cpu/cpuemu3.o \ - ./uae-cpu/cpuemu4.o ./uae-cpu/cpuemu5.o ./uae-cpu/cpuemu6.o \ - ./uae-cpu/cpuemu7.o ./uae-cpu/cpuemu8.o +ifeq ($(ENABLE_DSP_EMU),1) +CPPFLAGS += -DENABLE_DSP_EMU=1 +endif GUIOBJS = ./gui-sdl/dlgAbout.o ./gui-sdl/dlgAlert.o ./gui-sdl/dlgDevice.o \ - ./gui-sdl/dlgDisc.o ./gui-sdl/dlgJoystick.o ./gui-sdl/dlgKeyboard.o \ - ./gui-sdl/dlgMain.o ./gui-sdl/dlgMemory.o ./gui-sdl/dlgNewDisc.o \ + ./gui-sdl/dlgDisk.o ./gui-sdl/dlgJoystick.o ./gui-sdl/dlgKeyboard.o \ + ./gui-sdl/dlgMain.o ./gui-sdl/dlgMemory.o ./gui-sdl/dlgNewDisk.o \ ./gui-sdl/dlgRom.o ./gui-sdl/dlgScreen.o ./gui-sdl/dlgSound.o \ ./gui-sdl/dlgSystem.o ./gui-sdl/dlgFileSelect.o ./gui-sdl/sdlgui.o +GUIWINOBJS = ./gui-win/hatari-winicon.o ./gui-win/opencon.o -SRCS = audio.c bios.c blitter.c cart.c cfgopts.c configuration.c \ - createBlankImage.c debugui.c dialog.c dim.c fdc.c file.c floppy.c gemdos.c \ - hdc.c ikbd.c int.c ioMem.c ioMemTables.c joy.c keymap.c log.c \ - m68000.c main.c midi.c memorySnapShot.c mfp.c misc.c msa.c psg.c \ - printer.c rs232.c reset.c rtc.c st.c stMemory.c screen.c screenConvert.c \ - screenSnapShot.c shortcut.c sound.c spec512.c tos.c unzip.c vdi.c video.c \ - wavFormat.c xbios.c ymFormat.c zip.c +FALCOBJS = ./falcon/videl.o ./falcon/hostscreen.o ./falcon/nvram.o +ifeq ($(ENABLE_DSP_EMU),1) +FALCOBJS += ./falcon/dsp.o ./falcon/dsp_cpu.o ./falcon/dsp_disasm.o +endif + +SRCS = audio.c bios.c blitter.c cart.c cfgopts.c configuration.c options.c \ + createBlankImage.c cycles.c debugui.c dialog.c dim.c dmaSnd.c fdc.c file.c \ + floppy.c gemdos.c hdc.c ide.c ikbd.c int.c ioMem.c ioMemTabST.c \ + ioMemTabSTE.c ioMemTabTT.c ioMemTabFalcon.c joy.c keymap.c paths.c \ + log.c m68000.c main.c midi.c memorySnapShot.c mfp.c misc.c msa.c psg.c \ + printer.c rs232.c reset.c rtc.c scandir.c st.c stMemory.c screen.c \ + screenSnapShot.c shortcut.c sound.c spec512.c trace.c tos.c unzip.c \ + vdi.c video.c wavFormat.c xbios.c ymFormat.c zip.c OBJS = $(SRCS:.c=.o) -ALLOBJS = $(OBJS) $(GUIOBJS) $(CPUOBJS) +ALLOBJS = $(OBJS) $(GUIOBJS) $(CPUDIR)/cpu68k.a $(FALCOBJS) + +ifeq ($(SYS_WINDOWS),1) + ALLOBJS += $(GUIWINOBJS) +endif +ifneq ($(strip $(shell gcc -v 2>&1 |grep "cygwin")),) + ALLOBJS += $(GUIWINOBJS) +endif all: hatari @@ -42,32 +60,43 @@ all: hatari hatari: $(ALLOBJS) $(CC) $(LDFLAGS) $(ALLOBJS) $(SDL_LIBS) $(LIBS) -o hatari -clean: - rm -f *.o hatari - $(MAKE) -C gui-sdl/ clean - $(MAKE) -C uae-cpu/ clean - - # Sub-folder dependencies: -uae-cpu/%.o: uae-cpu/%.c - $(MAKE) -C uae-cpu/ all -uae-cpu/cpuemu%.o: uae-cpu/cpuemu.c - $(MAKE) -C uae-cpu/ all -uae-cpu/cpuemu.c: uae-cpu/gencpu.o uae-cpu/readcpu.c uae-cpu/cpudefs.c - $(MAKE) -C uae-cpu/ cpuemu.c -uae-cpu/cpudefs.c: uae-cpu/build68k.c uae-cpu/table68k - $(MAKE) -C uae-cpu/ cpudefs.c +.PHONY : $(CPUDIR)/cpu68k.a +$(CPUDIR)/cpu68k.a: + $(MAKE) -C $(CPUDIR) gui-sdl/%.o: gui-sdl/%.c - $(MAKE) -C gui-sdl/ all + $(MAKE) ENABLE_DSP_EMU=$(ENABLE_DSP_EMU) -C gui-sdl/ all + +gui-win/%.o: + $(MAKE) ENABLE_DSP_EMU=$(ENABLE_DSP_EMU) -C gui-win/ all + +falcon/%.o: falcon/%.c + $(MAKE) ENABLE_DSP_EMU=$(ENABLE_DSP_EMU) CPUDIR=$(CPUDIR) -C falcon/ + + +clean: + $(RM) *.o hatari + $(MAKE) -C gui-sdl/ clean + $(MAKE) -C gui-win/ clean + $(MAKE) -C $(CPUDIR) clean + $(MAKE) -C falcon/ clean + +distclean: + $(RM) *.o hatari + $(RM) Makefile.dep *~ *.bak *.orig + $(RM) convert/*~ convert/*.bak + $(MAKE) -C gui-sdl/ distclean + $(MAKE) -C gui-win/ distclean + $(MAKE) -C $(CPUDIR) distclean + $(MAKE) -C falcon/ distclean # Use "make depend" to generate file dependencies: -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $(SRCS) > Makefile.dep - $(MAKE) -C gui-sdl/ depend +Makefile.dep: Makefile + $(CC) -M $(CPPFLAGS) $(SRCS) > Makefile.dep -ifneq (,$(wildcard Makefile.dep)) -include Makefile.dep -endif +depend: Makefile.dep + $(MAKE) -C gui-sdl/ depend +-include Makefile.dep