Makefile 755 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
# classic cross-compilation tool-set
AS              = $(CROSS_COMPILE)as
LD              = $(CROSS_COMPILE)ld
CC              = $(CROSS_COMPILE)gcc
CPP             = $(CC) -E
AR              = $(CROSS_COMPILE)ar
NM              = $(CROSS_COMPILE)nm
STRIP           = $(CROSS_COMPILE)strip
OBJCOPY         = $(CROSS_COMPILE)objcopy
OBJDUMP         = $(CROSS_COMPILE)objdump

12
CFLAGS = -Wall -ggdb -I../include
13

Alessandro Rubini's avatar
Alessandro Rubini committed
14 15
PROGS = ptpdump adjtime jmptime chktime
LDFLAGS += -lrt
16 17 18

all: $(PROGS)

Alessandro Rubini's avatar
Alessandro Rubini committed
19
$(PROGS): $(wildcard *.h) $(wildcard ../include/ppsi/*.h)
20 21 22 23

%: %.c
	$(CC) $(CFLAGS) $*.c $(LDFLAGS) -o $@

24 25 26 27 28 29
%.o: %.c
	$(CC) $(CFLAGS) -c $*.c $(LDFLAGS) -o $@

ptpdump: dump-main.o dump-funcs.o
	$(CC) $(LDFLAGS) dump-main.o dump-funcs.o -o $@

30 31 32
clean:
	rm -f $(PROGS) *.o *~