# Comment/uncomment the following line to disable/enable debugging prints # DEBUG = y # Comment/uncomment the following line to disable/enable using of system # logger for info, error and debugging messages insted of using stderr. # USE_SYSLOG = y # Comment/uncomment the following line to disable/enable static linking # STATIC = y # Select destination directory for your compiled program, documentations, # and binary distribution. PREFIX = /usr/local # Select your specific host architecture and cpu name (autodetected) # ARCH = i386 # CPU = i486 # ****************************************************************** # *** END OF DEFINITION PART - DO NOT MODIFY UNDER THIS POINT!!! *** # ****************************************************************** TARGET = c6term SRCS = main.c misc.c encoding.c mgr_serv.c mgr_user.c DOCS = C6STP.SPECS FAQ GPL INSTALLAZIONE LEGGIMI TODO BINDIR = $(PREFIX)/bin DOCSDIR = $(PREFIX)/share/doc/$(TARGET) ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ -e s/arm.*/arm/ -e s/sa110/arm/) CPU ?= $(shell uname -m) CFLAGS = -Wall -D_GNU_SOURCE ifeq ($(DEBUG),y) CFLAGS += -ggdb -DC6_DEBUG # "-O" is needed to expand inlines else CFLAGS += -O2 endif ifeq ($(USE_SYSLOG),y) CFLAGS += -DC6_USE_SYSLOG endif ifeq ($(STATIC),y) CFLAGS += -static endif ifeq ($(ARCH),i386) # FIXME: can be used to other archs?? :-o CFLAGS += -march=$(CPU) endif # ***************************************************************************** # Actions section # ***************************************************************************** .PHONY : all .SECONDARY : $(TARGET:=.o) $(SRCS:.c=.o) all : .depend $(TARGET) .depend depend dep : $(CC) $(CFLAGS) -M $(SRCS) > .depend $(TARGET) : $(SRCS:.c=.o) $(CC) $(CFLAGS) -o $@ $^ ifeq ($(wildcard .depend),.depend) include .depend endif # ### The ChangeLog file ###################################################### .PHONY : ChangeLog ChangeLog : cvs2cl --prune --stdout > ChangeLog # ***************************************************************************** # Clean section # ***************************************************************************** .PHONY : distclean clean clean_deb clean : rm -f *~ core .depend rm -f $(TARGET) $(TARGET:=.o) $(SRCS:.c=.o) rm -f ChangeLog* distclean : clean clean_deb clean_deb : $(MAKE) -C debian clean # ***************************************************************************** # Install/Uninstall section # ***************************************************************************** .PHONY : install uninstall install : install -d $(BINDIR) $(DOCSDIR) install -s $(TARGET) $(BINDIR) install -m u=rw,go=r $(DOCS) $(DOCSDIR) uninstall : rm -f $(BINDIR)/$(TARGET) rm -rf $(DOCSDIR)