HDRS = dhcp4client.h
SRCS = $(COMMON_SRCS) $(CLIENT_SRCS)
OBJS = $(SRCS:.c=.o)
+LOBJS = $(SRCS:.c=.lo)
INCLUDES = -I$(TOP) -I$(TOP)/includes -I$(TOP)/dst -I.
CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) \
$(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRCS)
clean:
- -rm -f $(OBJS)
+ -rm -f $(OBJS) $(LOBJS)
realclean: clean
-rm -f $(PROG) *~ #*
ln ../minires/libres.a .; \
$(AR) x libres.a
+%.lo: %.c
+ $(CC) -o $@ $(CFLAGS) -fPIC -c $<
+
# Create the libraries
# minires/res_query.o contains an undefined symbol __h_errno_set, is not
# used by any dhcp code, and is optimized out by the linker when producing
libdhcp4client.a: $(OBJS) libres.a
$(AR) crus $@ $(OBJS) `$(AR) t libres.a | grep -v res_query.o`
-libdhcp4client-$(VER).so.0: $(OBJS) libres.a
- $(CC) -shared -o $@ -Wl,-soname,$@ $(OBJS) `$(AR) t libres.a | grep -v res_query.o`
+libdhcp4client-$(VER).so.0: $(LOBJS) libres.a
+ $(CC) $(LDFLAGS) $(CFLAGS) -shared -o $@ -Wl,-soname,$@ $(LOBJS) `$(AR) t libres.a | grep -v res_query.o`
# Dependencies (semi-automatically-generated)