#=========================================================================
#
# MAKE FILE FOR ROCKY
#
#
#=========================================================================
SHELL = /usr/bin/sh
VERSION = 0.1
DATE = `date '+%Y-%m-%d'`
PACKAGE = ROCKY
#---------------PATH INFO--------------------
LBIN = bin
LOBJ = obj
LSRC = src
LCLIENT = client
#--------------------------------------------
#----------- COMPILING INFOMATION-------------
CC = gcc
EXE = ROCKY
CLIENT = CLIENT_ROCKY
CDUBG =
CFLAGS = -Wall -g -o
# CFLAS = -Wall -Wextra -O2
LIBS = -lncurses -pthread
ALLFILES= $(wildcard $(LSRC)/*.c)
CLIENT_FILES=$(wildcard $(LCLIENT)/*.c)
DAEMON = ROCKY_DAEMON
# OBJS
OBJS = $(ALLFILES:%.c=%.o)
CLIENT_OBJS = $(CLIENT_FILES:%.c=%.o)
#----------------------------------------------
#PHONY
all: info dirs $(EXE) $(CLIENT)
info:
-@echo $(EXE) $(VERSION) IS BUILDING...
${EXE}: $(OBJS)
$(CC) $(CFLAGS) $@ $(OBJS) $(LIBS)
$(DAEMON):
$(CC) $(CFLAGS) $@
dirs:
-@mkdir -p $(LBIN) $(LOBJ)
$(CLIENT):$(CLIENT_OBJS)
$(CC) $(CFLAGS) $@ $(CLIENT_OBJS)
mv2dir:
-@mv $(EXE) $(LBIN)
-@mv $(CLIENT) $(LBIN)
clean:
-@rm $(PACKAGE)
-@rm -rf $(LBIN) $(LOBJ)
-@rm $(LSRC)/*.o
-@rm $(LCIENT)/*.o
-@rm $(CLIENT)
#---objs---
$(OBJS):%.o:%.c
$(CC) -c $< -o $@
$(CLIENT_OBJS):%.o:%.c
$(CC) -c $< -o $@
.PHONY: clean