Web lists-archives.com

Re: [Mingw-users] object not compiling




Yes those single letter ones are shorthand paths defined in a separate file, the header variables you mentioned are also defined in that same file, here's the snippet from there:
B:=$(TARGET_BINDIR)/$(DBG)
O:=$(TARGET_OBJDIR)/$(DBG)
S:=$(SRCDIR)/
OBJ_DIRECTORIES:=$(OBJDIR) $(TARGET_OBJDIR)
OUT_DIRECTORIES:=$(BINDIR) $(TARGET_BINDIR)
ALL_DIRECTORIES:=$(OBJ_DIRECTORIES) $(OUT_DIRECTORIES)
INCLUDES:=$(FI)"$(CC_INC)" $(FI)"$(SRCDIR)"
OUT_LIBS:=$(FL)"$(CC_LIB)" $(FL)"$(B)"
OBJ_LIBS:=$(FL)"$(CC_LIB)" $(FL)"$(O)"
SOURCES:=$(wildcard $(S)Codit*.c)
OBJECTS:=$(patsubst $(S)%.c,$(O)%.o,$(SOURCES))
#Headers
BASIC_H:=$(S)CoditBasic.h $(S)CoditBuild.h
FAULT_H:=$(S)CoditFault.h $(BASIC_H)
FILEOBJ_H:=$(S)CoditFileobj.h $(FAULT_H)
FILELST_H:=$(S)CoditFilelst.h $(FILEOBJ_H)
PROCOBJ_H:=$(S)CoditProcobj.h $(FILELST_H)
PROCLST_H:=$(S)CoditProclst.h $(PROCOBJ_H)
As for version that is just all the compile-able targets, in this case it's just:
version=user test
As for VPATH I'll move onto trying that once I get a working makefile for my targets as I'll upload that copy to my github repository before experimenting, I can always roll back the changes then.

On 30 May 2016 at 12:14, Keith Marshall <keithmarshall@xxxxxxxxxxxxxxxxxxxxx> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 30/05/16 11:39, Lee Shallis wrote:
> First the code snippet: $(version): TARGET_OBJECTS+= $(O)$@.o
> $(version): SOURCES+= $(S)$@.c $(version): COMPILE_BIN=$(CC)
> $(TARGET_LIBS) $(Fc) $(TARGET_OBJECTS) $(Fo) $(version): paths
> $(TARGET_OBJECTS); $(COMPILE_BIN) "$($@_OUT)" @echo
> VERSION_BUILD=$(VERSION_BUILD) @echo
> VERSION_MINOR=$(VERSION_MINOR) @echo
> VERSION_MAJOR=$(VERSION_MAJOR) @echo TARGET_OUT=$($@_OUT) @echo
> TARGET_OBJECTS=$(TARGET_OBJECTS)
> echo:$(TARGET_LARGE)_VERSION_BUILD=$(VERSION_NEXT_BUILD) > $(VMK)
> echo:$(TARGET_LARGE)_VERSION_MINOR=$(VERSION_NEXT_MINOR) >> $(VMK)
> echo:$(TARGET_LARGE)_VERSION_MAJOR=$(VERSION_NEXT_MAJOR) >> $(VMK)
>
> # General linker files $(O)CoditFileobj%.o:
> TARGET_HEADERS=$(FILEOBJ_H) $(O)CoditFilelst%.o
> $(O)CoditFileent%.o: TARGET_HEADERS=$(FILELST_H)
> $(O)CoditProcobj%.o: TARGET_HEADERS=$(PROCOBJ_H)
> $(O)CoditProclst%.o $(O)CoditProcent%.o:
> TARGET_HEADERS=$(PROCLST_H) # Target specific linker files
> $(O)user.o $(O)test.o: TARGET_HEADERS=$(PROCLST_H)
>
> # Produce linker files $(O)%.o: $(S)%.c $(TARGET_HEADERS) $(CC)
> $(CFLAGS) $(VDEFS) $(Fc) "$<" $(Fo) "$@"
>
> The problem I'm having is that the final object file that should
> be compiled is being ignored for some reason, it does Codit*.o just
> fine but when it gets to the target specific like test.o or user.o
> it just doesn't compile it and as a result the executable won't
> compile since the object file doesn't exist. Can anybody help me
> understand what is going wrong here?

Frankly, on the basis of the code snippet you've shown, I doubt if
anyone can; to me, it is incomprehensible, (and I'm hardly a novice
when it comes to writing makefiles, having written those for the
current mingwrt and w32api).  Perhaps you need to show more, e.g.:

1) What are $(version), $(O) and $(S)?  (If $(S) is path to sources,
as seems a likely SWAG, maybe you should consider using VPATH, or vpath).

2) How are $(FILEOBJ_H), $(FILELIST_H), $(PROCOBJ_H), and $(PROCLST_H)
defined?  I don't see that above, and your target-specific variable
assignments depend on them.

- --
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJXTCCcAAoJEMCtNsY0flo/YsMP/1S6jiweA+e/60sZ+Eew3Ypw
mbELj7hQ6/0O56iwL12vL+3Pq/Ar/pPHdoMaZs2RgVancnDT7QFMGLx0qQjm5AgU
/b6o1HP5C3qoCSm4KqvWdsu4D79GNwnTG9GRgZqpl4RvChRDGO92mCn/RPF06SND
BGYWbmoZFzojpFe+Hp2NkeEf7obrN4C/q0KvlLEzl2hkxsyFvfJEdtj5lf8ONe8l
HDy3Ay3CgPsftwhp9ZS5pO3It7QVhGKkLA0+Pty2CiJbyVHKabTzOGIMgkKtJCIO
nPkc3GrVfOU7OBuRiLX6KLDQYh7d8LnIPPtKO/QusV5v8xdJ7ENnehHVQQGGaF0P
sgUhHcwUPChQzoZ2QettLflWxUoUBhUP07Xku9xdaNnoIkdMW+E2655xRN9mFr0u
+MOcvfZl5xtWMAAwJw/YhuXXJQKQTyriMM+vGGeZQlD1yipPkYTGycLs2pWwcpW4
t0g7hTrx0QUuWoFsn0FZKwYKz6s3VB4xIZJMQ07DaptqYAshdKa6OkU0YIYEwVYm
0L2ikUrO0zWIYnvHyzJuZlnNA8kSMaNsuVL9yMwY4w9Eh8Som1f3ZcISqDoqnWK2
oK9RYIQvxLDO3kBRbLJI41YBWAbQzUuXwltkk6yb/OKJx3Ig+Ifix/pv+miNwEnl
2YEO2of9QsJdK0+MF5FC
=kTsR
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe