# !/bin/sh
# Makefile for heart beating processor 
# Created by Huang QL, 2000/12/26
#If you want to include which Module,Set the INC_XXX=$(INC_TRUE),
#or set it to $(INC_FALSE),then run the command: make alt
INC_TRUE=1
INC_FALSE=0

CC = gcc
CFLAGS=-D_REENTRANT -D_MAX_64COS_COOK_ -Wall -Wno-unused-function -g -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ -I/usr/local/lib/glib-2.0/include  -L/usr/local/lib -lglib-2.0
#-O2
prefix = /usr
includedir = $(prefix)/include
libdir = $(prefix)/lib
localinclude = ../include
platLIBPREFIX =../../../wxc2plat
INC_FLAGS = -I$(includedir)
INCLUDES = -I../include

XAPPLIB_FLAGS = -L$(platLIBPREFIX)/xapp
XAPPLD_LIBRARY = -lxapp
TCAPLIB_FLAGS = -L$(platLIBPREFIX)/tcap
TCAPLD_LIBRARY = -ltcap
SCCPLIB_FLAGS = -L$(platLIBPREFIX)/sccp
SCCPLD_LIBRARY = -lsccp
MTP3LIB_FLAGS = -L$(platLIBPREFIX)/mtp3 -lcurses
MTP3LD_LIBRARY = -lmtp3 
PUBLICLIB_FLAGS = -L$(platLIBPREFIX)/public
PUBLICLD_LIBRARY = -lpublic
DEBUGLIB_FLAGS = -L$(platLIBPREFIX)/debug
DEBUGLD_LIBRARY = -ldebug
SNMPLIB_FLAGS_I = -L$(platLIBPREFIX)/snmp
SNMPLD_LIBRARY_I = -lsnmp
SMPPLIB_FLAGS = -L$(platLIBPREFIX)/smppold
SMPPLD_LIBRARY = -lsmpp
IPTRANS_FLAGS = -L$(platLIBPREFIX)/iptrans
IPTRANS_LIBRARY = -liptrans
SCF_FLAGS = -L$(platLIBPREFIX)/scf
SCF_LIBRARY = -lscf
PPS_FLAGS = -L ../../OPR/lib
PPS_LIBRARY = -lopr

 

STATIC=

COMPILE.c=$(CC) $(CFLAGS)
LINK.c=$(CC) $(CFLAGS) 

COMPILE_SUFFIX=$(STATIC) $(INC_FLAGS)

LINK_SUFFIX= $(INC_FLAGS) \
$(PUBLICLIB_FLAGS) $(PUBLICLD_LIBRARY) \
$(SNMPLIB_FLAGS_I) $(SNMPLD_LIBRARY_I) \
$(XAPPLIB_FLAGS) $(XAPPLD_LIBRARY) \
$(TCAPLIB_FLAGS) $(TCAPLD_LIBRARY) \
$(SCCPLIB_FLAGS) $(SCCPLD_LIBRARY) \
$(MTP3LIB_FLAGS) $(MTP3LD_LIBRARY) \
$(DEBUGLIB_FLAGS) $(DEBUGLD_LIBRARY) \
$(SMPPLIB_FLAGS) $(SMPPLD_LIBRARY) \
$(IPTRANS_FLAGS) $(IPTRANS_LIBRARY) \
$(SCF_FLAGS) $(SCF_LIBRARY)\
$(PPS_FLAGS) $(PPS_LIBRARY)

PROGS=ppsm

#pps_OBJ =  ppsmain.o capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o ppsopr.o callingCardMsg.o callingCardState.o

pps_OBJ =  capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o callingCardMsg.o callingCardState.o tariffApplication.o callMeBack.o freeSMS.o feeTransfer.o masterSlaveCard.o radius.o gprs.o vas.o restapi.o ocs_user_table.o pps_redis.o
all:$(PROGS) 
#$(pps_OBJ)
# executive file
ppsm:$(pps_OBJ)
	@echo Linking $@
	@echo $(LINK_SUFFIX)
#	@$(LINK.c) -o $(PROGS) $(pps_OBJ) $(LINK_SUFFIX) -L../lib/ -lppsfuns -ldl -lz -lpopt -lncurses -lm 	

# obj files
#ppsmain.o:ppsmain.c
#	$(COMPILE.c) -c ppsmain.c $(INCLUDES)
capmsg.o:capmsg.c
	$(COMPILE.c) -c capmsg.c $(INCLUDES)

crd.o:crd.c
	$(COMPILE.c) -c crd.c $(INCLUDES)

dailyreport.o:dailyreport.c
	$(COMPILE.c) -c dailyreport.c $(INCLUDES)

loadtl.o:loadtl.c
	$(COMPILE.c) -c loadtl.c $(INCLUDES)

message.o:message.c
	$(COMPILE.c) -c message.c $(INCLUDES)

mfunc.o:mfunc.c
	$(COMPILE.c) -c mfunc.c $(INCLUDES)

ppsmap.o:ppsmap.c
	$(COMPILE.c) -c ppsmap.c $(INCLUDES)

ppsMibTable.o:ppsMibTable.c
	$(COMPILE.c) -c ppsMibTable.c $(INCLUDES)
	
ppsmib.o:ppsmib.c
	$(COMPILE.c) -c ppsmib.c $(INCLUDES)
	
ppsfunc.o:ppsfunc.c
	$(COMPILE.c) -c ppsfunc.c $(INCLUDES)

ppsm.o:ppsm.c
	$(COMPILE.c) -c ppsm.c $(INCLUDES)

precard.o:precard.c
	$(COMPILE.c) -c precard.c $(INCLUDES)

rammng.o:rammng.c
	$(COMPILE.c) -c rammng.c $(INCLUDES)

smppapi.o:smppapi.c
	$(COMPILE.c) -c smppapi.c $(INCLUDES)

ppsussd.o:ppsussd.c
	$(COMPILE.c) -c ppsussd.c $(INCLUDES)

callingCardMsg.o:callingCardMsg.c
	 $(COMPILE.c) -c callingCardMsg.c $(INCLUDES)
	 	
callingCardState.o:callingCardState.c
	$(COMPILE.c) -c callingCardState.c $(INCLUDES)
	

tariffApplication.o:tariffApplication.c
	$(COMPILE.c) -c tariffApplication.c $(INCLUDES)

callMeBack.o:callMeBack.c
	$(COMPILE.c) -c callMeBack.c $(INCLUDES)

freeSMS.o:freeSMS.c
	$(COMPILE.c) -c freeSMS.c $(INCLUDES)

feeTransfer.o:feeTransfer.c
	$(COMPILE.c) -c feeTransfer.c $(INCLUDES)

masterSlaveCard.o:masterSlaveCard.c
	$(COMPILE.c) -c masterSlaveCard.c $(INCLUDES)
radius.o:radius.c
	$(COMPILE.c) -c radius.c $(INCLUDES)
gprs.o:gprs.c
	$(COMPILE.c) -c gprs.c $(INCLUDES)
vas.o:vas.c
	$(COMPILE.c) -c vas.c $(INCLUDES)
restapi.o:restapi.c
	$(COMPILE.c) -c restapi.c $(INCLUDES)
ocs_user_table.o:ocs_user_table.c
	$(COMPILE.c) -c ocs_user_table.c $(INCLUDES)
pps_redis.o:pps_redis.c
	$(COMPILE.c) -c pps_redis.c $(INCLUDES)
clean:
	rm -f *.c~ *.o core ppsm *.c.bak 
