Commit c5f41db3 authored by Alessandro Rubini's avatar Alessandro Rubini

userspace: clean up sub-makefiles

Long ago we used to refer to installed shared libraries and headers,
during further steps of user-space compilation.  We use static libraries
since long ago, and we have all -I pointing to ../ within the source
tree.  Get rid of unneeded installation of headers and extra -I
in the command lines.

Meanwhile, make all sub-makefile a little more similar one another
(this is trivial, mostly a side effect of the above).

The commit has no effect on build commands and results.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent e6495ad0
......@@ -5,6 +5,8 @@ OBJS = trace.o init.o fpga_io.o util.o pps_gen.o i2c.o shw_io.o i2c_bitbang.o \
LIB = libwr.a
WR_INSTALL_ROOT ?= /usr/lib/white-rabbit
# # Standard stanza for cross-compilation (courtesy of the linux makefile)
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
......@@ -22,9 +24,6 @@ CFLAGS = -Wall -I. -O2 -DDEBUG -ggdb \
-I../mini-rpc \
-I$(LINUX)/arch/arm/mach-at91/include
all: $(LIB)
$(LIB): $(OBJS)
......
......@@ -4,8 +4,18 @@ SNMP_BUILD := $(wildcard $(SNMP_BUILD)/output/build/netsnmp-*)
NET_SNMP_CONFIG ?= $(SNMP_BUILD)/net-snmp-config
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
WR_INSTALL_ROOT ?= /usr/lib/white-rabbit
# # Standard stanza for cross-compilation (courtesy of the linux makefile)
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
# defer running "net-snmp-config --cflags" so it is visible in make output
CFLAGS += -fPIC -Wall $$($(NET_SNMP_CONFIG) --cflags | sed s,-I/usr/include,,)
......
......@@ -5,6 +5,8 @@ TOOLS += wrs_vlans wrs_dump_shmem
TOOLS += sdb-read
TOOLS += nbtee
WR_INSTALL_ROOT ?= /usr/lib/white-rabbit
# # Standard stanza for cross-compilation (courtesy of the linux makefile)
AS = $(CROSS_COMPILE)as
......
......@@ -3,6 +3,8 @@ OBJS = hal_exports.o hal_main.o hal_ports.o hal_config.o hal_timing.o
BINARY = wrsw_hal
WR_INSTALL_ROOT ?= /usr/lib/white-rabbit
# # Standard stanza for cross-compilation (courtesy of the linux makefile)
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
......@@ -14,18 +16,11 @@ STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
# We must include stuff from wr_ipc, which is installed.
# If this is build under build scripts, it's $WRS_OUTPUT_DIR/images/wr
WR_INSTALL_ROOT ?= /usr/lib/white-rabbit
WR_INCLUDE = $(WR_INSTALL_ROOT)/include
WR_LIB = $(WR_INSTALL_ROOT)/lib
CFLAGS = -O -g -Wall \
-I../include \
-I../libwr/include \
-I../mini-rpc \
-I$(LINUX)/arch/arm/mach-at91/include \
-I$(WR_INCLUDE)
-I$(LINUX)/arch/arm/mach-at91/include
ifdef WRS_HAL_DEBUG
CFLAGS += -DDEBUG
......@@ -40,9 +35,8 @@ $(BINARY): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
install: all
install -d $(WR_INSTALL_ROOT)/bin $(WR_INSTALL_ROOT)/include
install -d $(WR_INSTALL_ROOT)/bin
install $(BINARY) $(WR_INSTALL_ROOT)/bin
install ../include/hal/hal_exports.h wrsw_hal.h $(WR_INSTALL_ROOT)/include
clean:
rm -f $(BINARY) *.o *~
......@@ -4,6 +4,8 @@ SRCFILES = mac.c rtu_drv.c rtu_ext_drv.c rtu_hash.c rtu_fd.c rtud.c \
rtud_exports.c utils.c
OBJFILES = $(patsubst %.c,%.o,$(SRCFILES))
WR_INSTALL_ROOT ?= /usr/lib/white-rabbit
# # Standard stanza for cross-compilation (courtesy of the linux makefile)
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
......@@ -15,40 +17,27 @@ STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
# We must include stuff from various headers, which are installed.
# If this is build under build scripts, it's $WRS_OUTPUT_DIR/images/wr
WR_INSTALL_ROOT ?= /usr/lib/white-rabbit
WR_INCLUDE = $(WR_INSTALL_ROOT)/include
WR_LIB = $(WR_INSTALL_ROOT)/lib
CFLAGS = -O2 -Wall -ggdb \
-I../mini-rpc \
-I../include \
-I../libwr/include \
-I$(LINUX)/arch/arm/mach-at91/include \
-I$(WR_INCLUDE)
# -I$(CROSS_COMPILE_ARM_PATH)/../include
-I$(LINUX)/arch/arm/mach-at91/include
ifdef WRS_RTUD_DEBUG
CFLAGS += -DDEBUG
endif
LDFLAGS := -L../libwr -L../mini-rpc\
-lwr -lpthread -lminipc
RM := rm -f
.PHONY: all
all: $(PROGRAM)
$(PROGRAM): $(OBJFILES)
$(CC) -o $@ $(OBJFILES) $(LDFLAGS)
clean:
$(RM) $(PROGRAM) $(OBJFILES)
rm -f $(PROGRAM) *.o *~
install: all
cp $(PROGRAM) $(WR_INSTALL_ROOT)/bin
install -d $(WR_INSTALL_ROOT)/bin
install $(PROGRAM) $(WR_INSTALL_ROOT)/bin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment