[libami] Make 'clean' a libami target

To make it easier / cleaner to build libami by itself, make a clean
target and call into it from the top level makefile as needed.
This commit is contained in:
Adrian Chadd
2020-11-10 11:55:10 -08:00
parent 31b2a069ea
commit 59eae9c029
2 changed files with 9 additions and 2 deletions

View File

@@ -57,6 +57,9 @@ local_all : $(PROGS) $(MODULES)
lib_all :
@( cd libami; $(MAKE) all )
lib_clean :
@( cd libami; $(MAKE) clean )
.c.o:
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
@@ -170,8 +173,8 @@ ppmtoinfo : ppmtoinfo.o
localetest : localetest.o $(LIBAMI)
$(CC) -o localetest localetest.o $(LIBS)
clean :
$(RM) core $(PROGS) $(LIBAMI) Keyboard *.o libami/*.o
clean : lib_clean
$(RM) core $(PROGS) $(LIBAMI) Keyboard *.o
$(RM) lex.yy.c lex.c y.tab.c y.tab.h gram.h gram.c
$(RM) kbdlexer.c kbdmodule.h kbdmodule.c
$(RM) config.log

View File

@@ -16,6 +16,7 @@ bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
INSTALL = @INSTALL@
LN_S = @LN_S@
RM = -rm -f
OBJS = drawinfo.o module.o broker.o eventdispatcher.o mdscreen.o \
mdicon.o mdwindow.o kbdsupport.o hotkey.o \
@@ -29,6 +30,9 @@ SRCS = drawinfo.c module.c broker.c eventdispatcher.c mdscreen.c \
all : libami.a
clean :
$(RM) *.o libami.a
libami.a : $(OBJS)
ar rc libami.a $(OBJS)
$(RANLIB) libami.a