MAKE=make # Setting these makes sure that the subsequent include files know that # we are going to be threaded so they should do whatever they need to # support this. In particular, this makes the global variable 'errno' # become thread safe by replacing it with a call to the internal function # ___errno() on Solaris - and should do something similar on other operating # systems. Solaris also supports _TS_ERRNO to enable thread-safe errno # _REENTRANT is also required for the tempnam() function to be properly # thread-safe. DEFS=-D_REENTRANT -D_TS_ERRNO -DHMT_PROTECT # -DWITH_MPATROL SRCS= cmd.c \ display.c \ file.c \ hmt.c \ main.c \ util.c OBJS= $(SRCS:.c=.o) #CC=mipsel-linux-gcc PLATFORM=$(shell uname -s | cut -d- -f1) PROCESSOR=$(shell uname -p) CFLAGS=-g -std=c99 INCS= LIBS= ifeq ($(PLATFORM),CYGWIN_NT) CFLAGS=-g -mno-cygwin endif #ifeq ($(PLATFORM),Linux) #CFLAGS=-static -g #endif #CFLAGS=-g -O3 -fno-strict-aliasing #WARN=-pedantic -Wall -Wnested-externs -Wpointer-arith -Werror -Wno-unused WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long all: tags hmt hmt: ${OBJS} @echo "Linking..." @-[ -f $@ ] && mv $@ $@~ || exit 0 ${CC} -static-libgcc \ ${WARN} \ ${DEFS} \ ${CFLAGS} -o $@ \ ${OBJS} \ ${LIBS} @echo "Done..." clean: @-touch core rm -f hmt hmt~ *.exe core tags asm ${OBJS} ${AROBJS} rm -f *.raw *.raw.sum *.lh5 rm -rf hmt-* tags: @-ctags *.[ch] 2>> /dev/null .c.o: @echo " $<" @$(CC) $(CFLAGS) ${WARN} ${DEFS} ${INCS} -c $< -o $@ install: hmt strip hmt cp hmt /mod/bin/hmt ${OBJS}: lint.h