Conversation
| ifndef TARGET | ||
| TARGET ?= devo8 | ||
| default: $(TARGET) | ||
|
|
There was a problem hiding this comment.
We should get rid of the default. running make without a target should just fail.
src/Makefile
Outdated
| rm -f $(TARGET).$(EXEEXT) $(TARGET).exe $(TARGET).bin $(TARGET).dfu $(TARGET).list \ | ||
| $(TARGET).map $(ODIR)/*.o $(ODIR)/*.o_ $(ODIR)/*.P $(ODIR)/*.bin \ | ||
| filesystem/$(FILESYSYTEM) 2> /dev/null || true | ||
| $(foreach t,$(ALLTARGETS),$(eval $(call make-target,$t,$(notdir $(patsubst %/,%,$(dir $(wildcard target/tx/*/$(TARGET)))))))) |
There was a problem hiding this comment.
This doesn't seem right...how does $TARGET get set here?
src/Makefile.inc
Outdated
| $(wildcard $(SDIR)/config/*.c) | ||
|
|
||
| ifdef MODULAR | ||
| SRC_C += $(SDIR)/protocol/protocol.c |
There was a problem hiding this comment.
I never liked this. Modular builds are a target thing, and don't belong in the main makefile. but it is weird because the protocol code itself is here. I'm not sure what to do about it.
| # Note that this must be after the 1st rule so that it doesn't execute by default# | ||
| ################################################################################## | ||
| $(VERBOSE).SILENT: | ||
|
|
There was a problem hiding this comment.
This is one of the thinks I hate about Makefiles. why does the order of things like this matter? it is completely non-intuitive
| zip: $(TARGET).zip | ||
|
|
||
| %.zip: $(ALL) $(TARGET).dfu $(PROTO_MODULES) | ||
| #This is not an emulator build (emulator is hanled in target/common/emu/Makefile.inc) |
There was a problem hiding this comment.
knowledge of anything dfu related is target based and shouldn't be in the main file....but tis the general zip logic common to all tx? it is different for emus....it is at least somewhat different for radiolnk and opentx. Not sure if we can break this up or move it without making it either duplicated or hard to read.
src/Makefile.inc
Outdated
| #The main executable # | ||
| ###################### | ||
| $(TARGET).$(EXEEXT): $(LINKFILE) $(OBJS) $(LIBOPENCM3) | ||
| @echo " + Building '$@'" |
There was a problem hiding this comment.
libopencm3 stuff is target related. it really doesn't belong in the main makefile. except that it currently lives in the src/ directory. maybe it should go into a libs/ directory or under target somewhere...I dunno
There was a problem hiding this comment.
sure. we can. we need first define the MACROs and document somewhere. then the code can be much clean.
src/Makefile.inc
Outdated
|
|
||
| # Use VERBOSE=1 to enable verbose make | ||
| PROGMODE ?= STATUS_SCREEN | ||
|
|
There was a problem hiding this comment.
What is this? I can't find any reference to it anywhere else. No idea why we have it.
Move distclean to root Makefile Fix emu_devo8 move back from firmware
| ifeq ("$(SRC_CXX)", "") | ||
| $(CC) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) | ||
| $(CC) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(LFLAGS2) $(CFLAGS) $(EXTRA_CFLAGS) | ||
| else |
There was a problem hiding this comment.
Can we name his better? I have no idea what the difference is between LFLAGS and LFLAGS2 (Yes I know you didn't create it, but now is a good time to fix it)
| OPTIMIZE_DFU := 1 | ||
|
|
||
| TARGET=devo10 | ||
|
|
There was a problem hiding this comment.
Why do I need this in every Makefile? Isn't it inferrable by the directory I'm in? The less things I need to define the better.
On the other hand, hiding away definitions makes things harder to read...I'm torn
There was a problem hiding this comment.
I struggled as well.
I can pass TARGET from Makefile, maybe I should do that.
| ALLEMUS = $(foreach dir,$(ALLTXS:%=emu_%),$(if $(wildcard target/$(dir)),$(dir),)) | ||
| EMUS = $(addprefix emu_, $(TXS)) | ||
| ALLEMUS = $(addprefix emu_, $(ALLTXS)) | ||
|
|
There was a problem hiding this comment.
Does this work if not every target has an emu?
There was a problem hiding this comment.
I need to filter out some targets. but since we put target under family, it is a challenge to do so.
|
|
||
| include target/drivers/mcu/emu/Makefile.inc | ||
| SRC += $(SDIR)/target/tx/devo/devof7/ia9211_map.c | ||
| CFLAGS +=-I$(SDIR)/target/drivers/display/spi/ |
There was a problem hiding this comment.
This is weird to me. the ia9211_map file is emu only but lives in the devof7 dir?
There was a problem hiding this comment.
no. it is a include file used by devof7 lcd driver as well.
No description provided.