diff options
Diffstat (limited to 'Rules')
-rw-r--r-- | Rules | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -3,16 +3,31 @@ THISDIR=$(shell pwd) RELDIR=$(subst $(TOPDIR)/,,$(THISDIR)) -ANAME=$(subst /,_,$(RELDIR)).a +ONAME=$(subst /,_,$(RELDIR)).o + +ifndef SRCS SRCS=$(subst .o,.c,$(OBJS)) +endif + +ifdef OBJS -all: $(ANAME) +ifdef LIB -$(ANAME): $(OBJS) - rm -f $(ANAME) - ar rcs $(ANAME) $(OBJS) +all: $(LIB) -ifdef OBJS +$(LIB): $(OBJS) + rm -f $(LIB) + ar rcs $(LIB) $(OBJS) + ranlib $(LIB) + +else + +all: $(ONAME) + +$(ONAME): $(OBJS) + $(LD) -r -o $(ONAME) $(OBJS) + +endif dep: $(SRCS) rm -f .depend |