You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. CPPFLAGS =
  2. LDLIBS =
  3. CFLAGS = -pipe -g -O2 -Wall
  4. LDFLAGS = -pipe
  5. CC = gcc
  6. LD = gcc
  7. # Some "black" magic to determine optimal compiler flags for target
  8. # architecture
  9. TARGET_ARCH:= $(shell if [ \! -r .compile-options ] ; then ( \
  10. cpu=`grep cpu /proc/cpuinfo 2>&1 |head -1| \
  11. cut -d : -f 2-| sed -e 's/ //g'`; \
  12. if [ x"$$cpu" = x"" ] ; then \
  13. echo -fno-strength-reduce; \
  14. else if [ "$$cpu" = "386" ] ; then \
  15. echo -m386 -fno-strength-reduce; \
  16. else if [ "$$cpu" = "486" ] ; then \
  17. echo -m486 -fno-strength-reduce; \
  18. else if [ "$$cpu" = "Alpha" ] ; then \
  19. echo -fno-strength-reduce; \
  20. else echo main\(\)\{\} >.compile-options.c; \
  21. if gcc -mpentium -o .compile-options.o -c \
  22. .compile-options.c &>/dev/null; then \
  23. echo -mpentium -fstrength-reduce; \
  24. else if gcc -m486 -malign-functions=2 -malign-jumps=2 \
  25. -malign-loops=2 -o .compile-options.o -c \
  26. .compile-options.c &>/dev/null; then \
  27. echo -n -m486 -malign-functions=2 -malign-jumps=2; \
  28. echo ' '-malign-loops=2 -fno-strength-reduce; \
  29. else echo -m486; \
  30. fi;fi;fi;fi;fi;fi) > .compile-options; \
  31. rm -f .compile-options.c .compile-options.o; \
  32. fi; cat .compile-options)
  33. ASFLAGS = $(TARGET_ARCH)
  34. OBJS = rom-scan.o
  35. ##############################################################################
  36. ifeq (.depend,$(wildcard .depend))
  37. all: rom-scan
  38. include .depend
  39. else
  40. all: depend
  41. @$(MAKE) all
  42. endif
  43. ##############################################################################
  44. rom-scan: $(OBJS)
  45. ##############################################################################
  46. clean:
  47. $(RM) *~ *.o *.dvi *.log *.aux *yacc.tab.[ch] *yacc.output *lex.[co] \
  48. *.dat .depend .tmp_depend .compile-options*
  49. strip rom-scan >&/dev/null || true
  50. ##############################################################################
  51. depend:
  52. for i in *.c;do $(CPP) $(CPPFLAGS) -MM $$i;done >.tmp_depend
  53. mv .tmp_depend .depend