Makefile 984 Bytes
Newer Older
1 2 3
# All files are under A (short for ARCH): I'm lazy
A := arch-$(ARCH)

4
CFLAGS += -Itools
5

6
OBJ-y += $A/wrs-startup.o \
7 8
	$A/main-loop.o \
	$A/wrs-io.o \
9
	$A/wrs-calibration.o \
10
	$A/wrs-ipcserver.o \
11 12 13 14 15 16
	lib/cmdline.o \
	lib/conf.o \
	lib/libc-functions.o \
	lib/dump-funcs.o \
	lib/div64.o

17 18
# The user can set TIME=, but wrs is default
TIME ?= wrs
19
PROTO_EXT = whiterabbit
20 21 22 23 24

include time-$(TIME)/Makefile

# Unix time operations are always included as a fallback
include time-unix/Makefile
25
CFLAGS += -Iproto-ext-whiterabbit
26

27
# mini-rpc directory contains minipc library
28
export CROSS_COMPILE
29 30
MINIPC_DIR := $A/mini-rpc
MINIPC_LIB := $(MINIPC_DIR)/libminipc.a
31
CFLAGS += -I$(MINIPC_DIR)
32 33
.PHONY: $(MINIPC_LIB)
$(MINIPC_LIB):
34
	$(MAKE) -C $(MINIPC_DIR)
35

36
OBJ-y += $(MINIPC_LIB)
37 38 39 40 41

all: $(TARGET)

# to build the target, we need -lstd again, in case we call functions that
# were not selected yet (e.g., pp_open_globals() ).
42 43
$(TARGET): $(TARGET).o
	$(CC) -Wl,-Map,$(TARGET).map2 -o $@ $(TARGET).o -lrt
44