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

4
CFLAGS += -Itools
5 6
# Prevent a warning for a missing prototype in pp_printf, bug since ever
ARCH_PP_PRINTF_CFLAGS += -include ../$A/include/strnlen.h
7

8
OBJ-y += $A/wrs-startup.o \
9 10
	$A/main-loop.o \
	$A/wrs-io.o \
11
	$A/wrs-conf.o \
12
	$A/wrs-calibration.o \
13
	$A/wrs-ipcserver.o \
14
	$A/shmem.o \
15
	$A/util.o \
16 17 18 19
	lib/cmdline.o \
	lib/conf.o \
	lib/libc-functions.o \
	lib/dump-funcs.o \
20
	lib/drop.o \
21
	lib/assert.o \
22 23
	lib/div64.o

24
# We only support "wrs" time operations
25
TIME = wrs
26 27 28 29
include time-$(TIME)/Makefile

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

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

41
OBJ-y += $(MINIPC_LIB)
42 43 44 45

all: $(TARGET)

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