| PLEX86 | ||
|
makefile targets problemLVM vs. Drive Failure Once upon a midnight dreary, while Aikon pondered weak and weary over many a quaint and curious volume of forgotten lore...: For LVM, you... Ok, now I've tried solving my problem differently so I thought I might as well copy the actual code I'm working on. What I'm trying to do is to compile only the latest files (with the highest number) in the submitdirectory. for instance if the directory has the following files: sequence-asrabaig-1.c sequence-asrabaig-2.c sequence-user-2.c sequence-asrabaig-3.c sequence-user-1.c I would like to compile only: sequence-asrabaig-3.c sequence-user-2.c My makefile is copied below. The $(FILES) contains the list of all files and $(PROCESSEDFILES) contains the ones I want to compile. ............................................... SOURCEFILES = fileread.c OBJECTFILES = filetest.o HEADERFILES = filetest.h OUTPUTFILE = hoho searchprefix = sequence- ifdef $d SUBMITDIR = $d else SUBMITDIR = .-submit endif DIRFILES = $(wildcard $(SUBMITDIR)-*) FILES = $(notdir $(DIRFILES)) PROCESSEDFILES = currentstr = $(call latestfile,$(call searchstring,$(1))) # unique = $(if $(findstring $(call currentstr,$(1)),$(PROCESSEDFILES)),,PROCESSEDFILES += $(call currentstr,$(1))) define unique ifeq ($(findstring $(call currentstr,$(1)),$(PROCESSEDFILES)),$(1)) PROCESSEDFILES += $(call currentstr,$(1))) endif endef $(foreach f,$(FILES),$(call unique,$(f))) all: $(PROCESSEDFILES) $(PROCESSEDFILES): shell1 = rm -f $(OUTPUTFILE); shell2 = $(CC) $(SUBMITDIR)-$(1) $(SOURCEFILES) $(OBJECTFILES) -o $(OUTPUTFILE); shell3 = if hoho; then echo success; else echo failure; fi doit = echo $(1); echo $(call latestfile,$(call searchstring,$(1))) latestfile = $(word $(words $(call sortedsearchfiles,$(1))), $(call sortedsearchfiles,$(1))) sortedsearchfiles = $(sort $(filter $(1)%, $(FILES))) searchstring = $(searchprefix)$(word 2, $(subst -, , $(1))) ................................................ If anybody can point out the error it would be a great help. Right now the make command says ********* missing separator on line 27 (i.e. after endef of unique) Boot & install SUSE 10.1 LiveCD's using USB flash drive Hi, my tablet PC does not have a CD-ROM drive so I intend to install SUSE 10.1 onto my harddrive using my 1G USB... Regards, Asra
|
||||
Linux groups from Newsgroups The #1 Usenet Provider on the Internet
|
||||