Makefile 999 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
	arch-unix/unix-conf.o \
12 13 14 15
	lib/cmdline.o \
	lib/conf.o \
	lib/libc-functions.o \
	lib/dump-funcs.o \
16
	lib/drop.o \
17 18
	lib/div64.o

19 20
# The user can set TIME=, but wrs is default
TIME ?= wrs
21 22 23 24 25

include time-$(TIME)/Makefile

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

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

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

all: $(TARGET)

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