-
Notifications
You must be signed in to change notification settings - Fork 159
[WIP] Refector Makefile #786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
b6682f4
8d49805
29427d7
6443e5f
d572f63
64512a0
c8a16ca
c9e7d0f
d7f40eb
b1293b3
041ec47
c3dd365
63588ec
6786457
0ccc9fe
aef7152
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,9 @@ SRCS := $(SRC_C) $(SRC_CXX) $(SRC_S) | |
| #This section intermediate build files # | ||
| ############################################ | ||
| ODIR = $(SDIR)objs/$(TARGET)$(ODIREXT)/ | ||
| OBJS := $(patsubst %.c,$(ODIR)%.o,$(notdir $(SRCS))) | ||
| OBJS := $(patsubst %.c,$(ODIR)%.o,$(notdir $(SRC_C))) $(patsubst %.cpp,$(ODIR)%.o,$(notdir $(SRC_CXX))) | ||
|
|
||
| $(warning $(OBJS)) | ||
|
|
||
| ifdef MODULAR | ||
| PROTO_OBJS := $(addprefix $(ODIR), $(notdir $(PROTO_SRC_C:.c=.o))) | ||
|
|
@@ -213,31 +215,30 @@ $(MODELDIR): | |
| #The main executable # | ||
| ###################### | ||
| $(SDIR)$(TARGET).$(EXEEXT): $(LINKFILE) $(OBJS) $(LIBOPENCM3) | ||
| @echo " + Building '$@' '$(SRC_CXX)'" | ||
| @echo " + Building '$(notdir $@)'" | ||
| ifdef LINKFILE #Create an empty 'obj/$(TARGET)/optimize.ld' just in case the linker script needs it | ||
| echo "" > $(ODIR)optimize.ld | ||
| endif | ||
| ifeq ("$(SRC_CXX)", "") | ||
| $(CC) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) | ||
| $(CC) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(LFLAGS2) $(CFLAGS) $(EXTRA_CFLAGS) | ||
| else | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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) |
||
| $(CXX) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) | ||
| $(CXX) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(LFLAGS2) $(CFLAGS) $(EXTRA_CFLAGS) | ||
| endif | ||
|
|
||
|
|
||
| ############################## | ||
| #Build rules for all .o files# | ||
| ############################## | ||
| $(ODIR)%.o: %.c | ||
| @echo " + Compiling '$<'" | ||
| $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basename $(notdir $<))) -c -o $@ $< | ||
| @echo " + Compiling '$(notdir $<)'" | ||
| $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basename $(notdir $<))) -MT $@ -MD -MP -MF $(@:.o=.d) -c -o $@ $< | ||
|
|
||
| $(ODIR)%.o: %.cpp | ||
| @echo " + Compiling '$<'" | ||
| $(CXX) $(CXXFLAGS) $(EXTRA_CFLAGS) $(CXXFLAGS_$(basename $(notdir $<))) -c -o $@ $< | ||
| @echo " + Compiling '$(notdir $<)'" | ||
| $(CXX) $(CXXFLAGS) $(EXTRA_CFLAGS) $(CXXFLAGS_$(basename $(notdir $<))) -MD -MP -MF $(@:.o=.d) -c -o $@ $< | ||
|
|
||
| #For module building | ||
| $(ODIR)%.o_: %.c | ||
| @echo " + Compiling '$<' as module" | ||
| @echo " + Compiling '$(notdir $<)' as module" | ||
| $(CC) $(CFLAGS) $(MODULE_CFLAGS) $(CFLAGS_$(basename $(notdir $<))) -c -o $@ $< | ||
|
|
||
| ############################## | ||
|
|
@@ -250,3 +251,4 @@ $(ODIR)hgstamp: | |
| echo $(HGVERSION) > $(ODIR)hgstamp | ||
|
|
||
| include $(SDIR)fs/Makefile.inc | ||
| -include $(OBJS:.o=.d) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,7 @@ LANGUAGE := devo10 | |
|
|
||
| OPTIMIZE_DFU := 1 | ||
|
|
||
| TARGET=devo10 | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I struggled as well. |
||
| include $(SDIR)/target/tx/devo/common/Makefile.inc | ||
| include $(SDIR)/Makefile.inc | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work if not every target has an emu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to filter out some targets. but since we put target under family, it is a challenge to do so.