aboutsummaryrefslogtreecommitdiffstats
path: root/src/hal/Submakefile
blob: dbffff47eeac0e84c43f8538c8258a8ac488df70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
INCLUDES += hal

../include/%.h: ./hal/%.h
	cp $^ $@

HALLIBSRCS := hal/hal_lib.c $(ULAPISRCS)
$(call TOOBJSDEPS, $(HALLIBSRCS)): EXTRAFLAGS += -fPIC $(ULAPI_CFLAGS)
USERSRCS += $(HALLIBSRCS)
ifeq ($(BUILD_SYS),uspace)
HALLIB_LIBS := -pthread -lrt
else
HALLIB_LIBS := -lrt
endif

HALLIB := ../lib/liblinuxcnchal.so

$(HALLIB).0: $(call TOOBJS, $(HALLIBSRCS))
	$(ECHO) Creating shared library $(notdir $@)
	@mkdir -p ../lib
	@rm -f $@
	$(Q)$(CC) $(LDFLAGS) -Wl,-soname,$(notdir $@) -shared -o $@ $^ $(HALLIB_LIBS) $(ULAPI_LDFLAGS)

HALMODULESRCS := hal/halmodule.cc
PYSRCS += $(HALMODULESRCS)

HALMODULE := ../lib/python/_hal.so
$(HALMODULE): $(call TOOBJS, $(HALMODULESRCS)) $(HALLIB)
	$(ECHO) Linking python module $(notdir $@)
	$(Q)$(CXX) $(LDFLAGS) -shared -o $@ $^

TARGETS += $(HALLIB) ../lib/liblinuxcnchal.so.0
PYTARGETS += $(HALMODULE)
bues.ch cgit interface