# $Id: Makefile,v 1.2 1998/01/06 21:03:46 ewt Exp $ include ../Makeconfig DEFS += -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH) #---------------------------------------------------------------------- all: insmod rmmod lsmod ksyms libmodutils.a(main.o insmod.o rmmod.o logger.o) ifeq ($(COMBINE_INSMOD_RMMOD),y) insmod: main.o insmod.o rmmod.o logger.o ../obj/libobj.a ../util/libutil.a $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ rmmod: insmod ln -sf $^ $@ insmod.o: insmod.c $(CC) $(CFLAGS) $(DEFS) -Dmain=insmod_main -c -o $@ $< rmmod.o: rmmod.c $(CC) $(CFLAGS) $(DEFS) -Dmain=rmmod_main -c -o $@ $< else insmod: insmod.o logger.o ../obj/libobj.a ../util/libutil.a $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ rmmod: rmmod.o logger.o ../util/libutil.a $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ endif lsmod: lsmod.o logger.o ../util/libutil.a $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ ksyms: ksyms.o logger.o ../util/libutil.a $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ realclean clean: rm -f *.o .depend insmod rmmod lsmod ksyms install install-bin: all $(INSTALL) insmod $(SBINDIR) $(INSTALL) -c rmmod $(SBINDIR) $(INSTALL) -c lsmod $(SBINDIR) $(INSTALL) -c ksyms $(SBINDIR) dep depend: gcc -M $(CFLAGS) $(DEFS) *.c > .depend ifeq (.depend,$(wildcard .depend)) include .depend endif