head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2005.05.30.11.58.57;	author zesus;	state Exp;
branches;
next	;


desc
@@


1.1
log
@*** empty log message ***
@
text
@#---------------------------------------------
#
#   Makefile for Netfire
#  
#   Created by wizard@@KLDP.net
#   Date : 2005.05.19
#
#---------------------------------------------

#---------------------------------------------
# Customize Macros
#---------------------------------------------
VERSION = 0.1
ARCH = noarch

#---------------------------------------------
# Define utilities
#---------------------------------------------
RM = rm -rf
CP = cp
MKDIR = mkdir
TAR = tar zcvf
RPMBUILD = rpmbuild -ba
CC = gcc
CFLAGS =  -g -Wall -ansi

#---------------------------------------------
# Define directories and file name
#---------------------------------------------
INSTALL_DIR = /usr/local/bin
NETFIRE_LIB = libnetfire.a

#---------------------------------------------
# Define all objects
#---------------------------------------------
NETFIRED_OBJS = netfired.o 
TEST_OBJS = client_echo.o
NETFIRE_OBJS = netfire.o
ALL_OBJS := $(wildcard *.o) $(wildcard *.exe) $(wildcard *.c~)


#---------------------------------------------
# Describe objects
#---------------------------------------------
all : netfired netfire client_echo

netfired : $(NETFIRED_OBJS)

netfire	: $(NETFIRE_OBJS)

#lib : 
#	@@echo " "
#	@@echo "Build netfire library..."
#	$(CC) -x $(CFLAGS) $<
#	$(AR) $(ARFLAGS) $@@ $*.o

clean :
	@@echo "Cleaning all objects and executables..."
	$(RM) netfired netfire client_echo $(ALL_OBJS)
	@@echo " "
	@@echo "Completed."

#---------------------------------------------
# Install built images
#---------------------------------------------
install : netfired
	@@if [ -d $(INSTALL_DIR) ] ; \
	then \
	cp netfired $(INSTALL_DIR); &&\
	chmod a+x $(INSTALL_DIR); &&\
	chmod og-w $(INSTALL_DIR) &&\
	echo "Installed in $(INSTALL_DIR) successfully.";\
	else \
	echo "Sorry, $(INSTALL_DIR) doesn't exist"; false;\
	fi

#---------------------------------------------
# Package netfire into RPM and tarball
#---------------------------------------------
dist : netfire-$(VERSION).tar.gz netfire-$(VERSION).$(ARCH).rpm

netfire-$(VERSION).tar.gz: netfired.* client_echo.*
	@@echo " "
	@@echo "Packaging tarball..."
	$(RM) netfire-$(VERSION)
	$(MKDIR) netfire-$(VERSION)
	$(CP) *.c *.exe Makefile netfire-$(VERSION)
	$(TAR) $@@ netfire-$(VERSION)

netfire-$(VERSION).$(ARCH).rpm: netfired.* client_echo.*
	@@echo " "
	@@echo "Packaging rpms..."
	$(RPMBUILD) $(RPM_SPEC)
@
