include $(APPS_DIR)/apps.mk

# Under Solaris, you need to 
#    CFLAGS += -xO2 -Xc
#    LDLIBS += -lnsl -lsocket
# Some versions of Linux may need
    CFLAGS +=  -D_GNU_SOURCE
# To cross-compile
# CC = mips-uclibc-gcc
# To check for lint
# -Wundef not recognized by gcc-2.7.2.3
#CFLAGS += -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow \
# -Waggregate-return -Wnested-externs -Winline -Wwrite-strings \
# -Wstrict-prototypes

CFLAGS += -O 
LDFLAGS += -s

TARGET = ntpclient

all: $(TARGET)

test: ntpclient
	./ntpclient -d -r <test.dat

$(TARGET): ntpclient.o phaselock.o

adjtimex: adjtimex.o

clean:
	rm -f ntpclient adjtimex *.o

dist: install
	
install:
	$(STRIP) $(TARGET)
	cp $(TARGET) $(TARGET_ROOT_DIR)/usr/sbin/.