summaryrefslogtreecommitdiff
path: root/src/hal/Submakefile
blob: 5b3c88121f921b42a2471f589f72c60d691f288e (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
INCLUDES += hal

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

HALLIBSRCS := hal/hal_lib.c $(ULAPISRCS)
$(call TOOBJSDEPS, $(HALLIBSRCS)): EXTRAFLAGS += -fPIC
USERSRCS += $(HALLIBSRCS)

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 $@ $^

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)