Skip to content

Commit

Permalink
streamline make file
Browse files Browse the repository at this point in the history
  • Loading branch information
ashblair committed Jan 13, 2023
1 parent 83693ec commit a9b9083
Show file tree
Hide file tree
Showing 25 changed files with 30 additions and 26 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
/launch.sh
/log.txt
/log_gladeparse.txt
/bin
/bin
/.vscode
21 changes: 21 additions & 0 deletions LICENSE.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 T. Ashton Blair, Jr.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
23 changes: 7 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ EXE := $(notdir $(CWD))$(EXE_SFX)
ICONFILE := $(CWD)/share/icons/small.ico
USETERMINAL := false
LOGFILE := $(CWD)/log.txt
DEPFILE := $(CWD)/dep.txt
DIRFILE := $(CWD)/dir.txt

#updating base directory structure:
Expand Down Expand Up @@ -93,10 +92,11 @@ allinBLD := $(shell find $(BLD) -type f)
allinRSC := $(shell find $(RSC) -type f)
allinSRC := $(shell find $(SRC) -type f)
SRCS := $(filter %.cpp, $(allinSRC))
DEPS := $(addprefix $(BLD)/, $(addsuffix .d, $(SRCS)))
DEPS := $(filter %.d, $(allinBLD))
DEL_BLD := $(filter-out $(DEPS:%.d=%.o), $(filter $(BLD)/$(SRC)/%.o, $(allinBLD)))
OBJS := $(addprefix $(BLD)/, $(addsuffix .o, $(SRCS)))
OBJS += $(addprefix $(BLD)/, $(addsuffix .o, $(allinRSC)))
DEL_BLD := $(filter-out $(BLD)/$(EXE), $(filter-out $(DEPS), $(filter-out $(OBJS), $(allinBLD))))
DEL_BLD += $(filter-out $(BLD)/$(EXE), $(filter-out $(DEPS), $(filter-out $(OBJS), $(allinBLD))))
RUN_DT := $(EXE).desktop
RUN_SH := $(EXE).sh

Expand Down Expand Up @@ -156,15 +156,10 @@ $(BLD)/$(RSC)/%.o: $(RSC)/%
@echo resource $< made into object $@ >> $(LOGFILE) ;

$(BLD)/$(SRC)/%.o: $(SRC)/%
@$(CXX) $(CXX_FLAGS) -I$(INC) $(CFLAGS) $< -c -o $@
@echo new object file compiled [$@] >> $(LOGFILE)

$(BLD)/$(SRC)/%.d: $(SRC)/%
@$(CXX) $(CXX_FLAGS) -I$(INC) -MM $< -MF $@
@STEM=$(subst .cpp,,$*) ; \
sed -i "s,$${STEM}.o,$(BLD)/$(SRC)/$${STEM}.cpp.o $@," $@ ; \
sed -i "s,$< ,," $@ ;
@echo new depend file compiled [$@] >> $(DEPFILE)
@$(CXX) -I$(INC) $< -MM -MT '$@' -MF $(subst .o,.d,$@)
@sed -i 's/$(SRC)\/$* //g' $(subst .o,.d,$@)
@$(CXX) $(CXX_FLAGS) -I$(INC) $(CFLAGS) -c $< -o $@
@echo new object + depend file compiled [$@ + .d] due to [$?] >> $(LOGFILE)

.PHONY: logsetup
logsetup:
Expand Down Expand Up @@ -196,10 +191,6 @@ logsetup:
@echo [allinRSC=$(allinRSC)] >> $(LOGFILE)
@echo [allinSRC=$(allinSRC)] >> $(LOGFILE)
@echo [OBJS=$(OBJS)] >> $(LOGFILE)
@if [ -f $(DEPFILE) ]; then \
echo -------\>MADE DEPENDS FILES WHEN INCLUDING: >> $(LOGFILE) ; \
cat $(DEPFILE) >> $(LOGFILE) ; \
$(RM) $(DEPFILE) ; fi ;
@echo -----\>MAKE OUTPUT FOLLOWS: >> $(LOGFILE)

.PHONY: logclear
Expand Down
2 changes: 0 additions & 2 deletions dep/APCalc.d

This file was deleted.

2 changes: 0 additions & 2 deletions dep/GUI.d

This file was deleted.

1 change: 0 additions & 1 deletion dep/mfloat.d

This file was deleted.

1 change: 0 additions & 1 deletion dep/mint.d

This file was deleted.

1 change: 0 additions & 1 deletion dep/stdafx.d

This file was deleted.

2 changes: 0 additions & 2 deletions dep/widgets.d

This file was deleted.

Binary file removed obj/dbg/APCalc.o
Binary file not shown.
Binary file removed obj/dbg/GUI.o
Binary file not shown.
Binary file removed obj/dbg/glade.glade.o
Binary file not shown.
Binary file removed obj/dbg/mfloat.o
Binary file not shown.
Binary file removed obj/dbg/mint.o
Binary file not shown.
Binary file removed obj/dbg/stdafx.o
Binary file not shown.
Binary file removed obj/dbg/style.css.o
Binary file not shown.
Binary file removed obj/dbg/widgets.o
Binary file not shown.
Binary file removed obj/rel/APCalc.o
Binary file not shown.
Binary file removed obj/rel/GUI.o
Binary file not shown.
Binary file removed obj/rel/glade.glade.o
Binary file not shown.
Binary file removed obj/rel/mfloat.o
Binary file not shown.
Binary file removed obj/rel/mint.o
Binary file not shown.
Binary file removed obj/rel/stdafx.o
Binary file not shown.
Binary file removed obj/rel/style.css.o
Binary file not shown.
Binary file removed obj/rel/widgets.o
Binary file not shown.

0 comments on commit a9b9083

Please sign in to comment.