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.

70 lines
1.5 KiB

2 years ago
  1. MAKE=make
  2. # Setting these makes sure that the subsequent include files know that
  3. # we are going to be threaded so they should do whatever they need to
  4. # support this. In particular, this makes the global variable 'errno'
  5. # become thread safe by replacing it with a call to the internal function
  6. # ___errno() on Solaris - and should do something similar on other operating
  7. # systems. Solaris also supports _TS_ERRNO to enable thread-safe errno
  8. # _REENTRANT is also required for the tempnam() function to be properly
  9. # thread-safe.
  10. DEFS=-D_REENTRANT -D_TS_ERRNO -DHMT_PROTECT
  11. # -DWITH_MPATROL
  12. SRCS= cmd.c \
  13. display.c \
  14. file.c \
  15. hmt.c \
  16. main.c \
  17. util.c
  18. OBJS= $(SRCS:.c=.o)
  19. #CC=mipsel-linux-gcc
  20. PLATFORM=$(shell uname -s | cut -d- -f1)
  21. PROCESSOR=$(shell uname -p)
  22. CFLAGS=-g -std=c99
  23. INCS=
  24. LIBS=
  25. ifeq ($(PLATFORM),CYGWIN_NT)
  26. CFLAGS=-g -mno-cygwin
  27. endif
  28. #ifeq ($(PLATFORM),Linux)
  29. #CFLAGS=-static -g
  30. #endif
  31. #CFLAGS=-g -O3 -fno-strict-aliasing
  32. #WARN=-pedantic -Wall -Wnested-externs -Wpointer-arith -Werror -Wno-unused
  33. WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long
  34. all: tags hmt
  35. hmt: ${OBJS}
  36. @echo "Linking..."
  37. @-[ -f $@ ] && mv $@ $@~ || exit 0
  38. ${CC} -static-libgcc \
  39. ${WARN} \
  40. ${DEFS} \
  41. ${CFLAGS} -o $@ \
  42. ${OBJS} \
  43. ${LIBS}
  44. @echo "Done..."
  45. clean:
  46. @-touch core
  47. rm -f hmt hmt~ *.exe core tags asm ${OBJS} ${AROBJS}
  48. rm -f *.raw *.raw.sum *.lh5
  49. rm -rf hmt-*
  50. tags:
  51. @-ctags *.[ch] 2>> /dev/null
  52. .c.o:
  53. @echo " $<"
  54. @$(CC) $(CFLAGS) ${WARN} ${DEFS} ${INCS} -c $< -o $@
  55. install: hmt
  56. strip hmt
  57. cp hmt /mod/bin/hmt
  58. ${OBJS}: lint.h