Makefile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. CC = gcc
  2. #For Debug
  3. #CFLAGS = -g `allegro-config --cflags debug` -I../src -Wall -pg -DISPAL -DNO_DECIMAL -DUNIX -DFAST_RDOP -DLSB_FIRST -DUSE_SOUND
  4. #For Retail
  5. CFLAGS = -I$(SRC)/include -I$(SRC) -g `allegro-config --cflags release`l -DISNTSC -DNO_DECIMAL -DUNIX -DFAST_RDOP -DLSB_FIRST -DDEBUG -DUSE_SOUND
  6. # -fomit-frame-pointer -funroll-loops
  7. #-DNO_N_KEY
  8. #-DUSE_SOUND
  9. #-DDETECT_BUS_CONFLICT
  10. #-DISNTSC or -DISPAL
  11. #-DDEBUG
  12. LDFLAGS = `allegro-config --libs debug` -lpthread
  13. #-pg #-lefence
  14. #debug` -lpthread -lefence -pg
  15. #release` -lpthread
  16. #-pg
  17. SRC=../src
  18. PLUGINS_DIR=pluginsmanager/plugins/
  19. MAPPERS_DIR=mappersmanager/mappers/
  20. PLUGINS=$(shell ls $(SRC)/$(PLUGINS_DIR)/*.c)
  21. MAPPERS=$(shell ls $(SRC)/$(MAPPERS_DIR)/*.c)
  22. all: tines
  23. tines: tines.o corecpu.o apu.o ppu.o plugins.o mappers.o memory.o
  24. $(CC) -o $@ $(LDFLAGS) $^
  25. apu.o: $(SRC)/apu/Sound.c $(SRC)/apu/SndAlleg.c
  26. $(CC) $(CFLAGS) -c $^ -o $@
  27. corecpu.o: $(SRC)/corecpu/corecpu.c
  28. $(CC) $(CFLAGS) -Wno-pointer-sign -c $^ -o $@
  29. tines.o: $(SRC)/main.c $(SRC)/paddle.c $(SRC)/NESCarts.c
  30. $(CC) $(CFLAGS) -c $^ -o $@
  31. memory.o: $(SRC)/memorymanager/memory.c
  32. $(CC) $(CFLAGS) -c $^ -o $@
  33. ppu.o: $(SRC)/ppu/ppu.c $(SRC)/ppu/ppu.memory.c $(SRC)/ppu/debug/ppu.debug.c
  34. $(CC) $(CFLAGS) -c $^ -o $@
  35. mappers.o: $(SRC)/mappersmanager/manager.c $(SRC)/mappersmanager/utils.c $(MAPPERS)
  36. $(CC) $(CFLAGS) -c $^ -o $@
  37. plugins.o: $(SRC)/pluginsmanager/manager.c $(PLUGINS)
  38. $(CC) $(CFLAGS) -c $^ -o $@
  39. .PHONY: clean
  40. clean:
  41. rm -Rf *.a *.o *~ core