# Uncomment for Windows
# CFLAGS = -D WINDOWS

# Uncomment for Solaris
# CFLAGS = -D SOLARIS

# Uncomment to compile without statistic functions and without mm library
# CFLAGS += -D NOSTATS

# Uncomment to add debug info
# CFLAGS += -ggdb -O0

all: ../bin/smsd ../bin/getsms ../bin/putsms

../bin/smsd: smsd.c extras.o locking.o cfgfile.o logging.o alarm.o smsd_cfg.o charset.o stats.o blacklist.o whitelist.o
ifneq (,$(findstring NOSTATS,$(CFLAGS)))
	  $(CC) $(CFLAGS) -o $@ $^
else 
	  $(CC) `mm-config --cflags` $(CFLAGS) -o $@ $^ `mm-config --ldflags --libs`
endif

../bin/getsms: getsms.c extras.o locking.o cfgfile.o logging.o alarm.o charset.o modeminit.o
	$(CC) $(CFLAGS) -o $@ $^ 

../bin/putsms: putsms.c extras.o locking.o cfgfile.o logging.o alarm.o charset.o modeminit.o
	$(CC) $(CFLAGS) -o $@ $^ 

clean:
	rm -f *.o ../bin/smsd ../bin/getsms ../bin/putsms
