all:ttsc1 tlgtd vma2offset
clean:ttsc1.clean
CC=gcc
CPPFLAGS:=$(CPPFLAGS) -I.
CFLAGS:=$(CFLAGS) -std=gnu11 -O3 -mtune=native -g -fPIC -pthread -Wall 
LDFLAGS=$(CFLAGS) -lpthread -lm
ifeq ($(filter -DKSYM_LOCATION%,$(CPPFLAGS)),)
ttsc1.o: CPPFLAGS:=$(CPPFLAGS) -DKSYM_LOCATION=\"$(shell pwd)/ksym\"
endif
ttsc1.o:ttsc1.c IA64_tsc_info.h IA64_rdtsc.h
tlgtd.o:tlgtd.c linux_gtod_page.h
ttsc1: ttsc1.o
tlgtd: tlgtd.o
vma2offset.o:vma2offset.c
vma2offset: vma2offset.o
ttsc1.clean:
	@rm -vf ttsc1 ttsc1.o tlgtd tlgtd.o vma2offset vma2offset.o

