Commit 023c2ae8 authored by Mathieu Maret's avatar Mathieu Maret

Makefile: add all rule

parent 601995f8
......@@ -18,7 +18,6 @@ lib = libexample.so
lib_src = lib.c
lib_obj = $(lib_src:%.c=%.o)
lib_dep = $(lib_src:%.c=%.d)
$(info $$lib_obj is ${lib_obj})
sources = $(filter-out $(lib_src), $(wildcard *.c))
objects = $(sources:%.c=%.o)
......@@ -29,18 +28,19 @@ cxx_sources = $(wildcard *.cpp)
cxx_objects = $(cxx_sources:%.cpp=%.o)
cxx_depends = $(cxx_sources:%.cpp=%.d)
all: $(bin) $(cxxbin) $(lib)
$(bin): $(objects)
$(cxxbin) : $(cxx_objects)
$(lib): CFLAGS += -fpic
$(lib): $(lib_obj)
# C++ compilation (Use implicit LINK.CC)
$(cxxbin):
$(LINK.cc) $^ $(LDLIBS) -o $@
$(lib): CFLAGS += -fpic
$(lib): $(lib_obj)
%.so:
$(LINK.c) -shared $^ $(LDLIBS) -o $@
......
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