mirror of
https://github.com/JorjBauer/aiie.git
synced 2025-01-29 21:31:10 +00:00
better (simpler, more modern) dependency handling
This commit is contained in:
parent
fed866e686
commit
c3abb52176
15
Makefile
15
Makefile
@ -51,13 +51,10 @@ clean:
|
||||
rm -f *.o *~ */*.o */*~ testharness.basic testharness.verbose testharness.extended testharness apple/diskii-rom.h apple/applemmu-rom.h apple/parallel-rom.h aiie-sdl *.d */*.d
|
||||
|
||||
# Automatic dependency handling
|
||||
-include $(OBJS:.o=.d)
|
||||
%.o: %.cpp
|
||||
g++ -c $(CXXFLAGS) $^ -o $*.o
|
||||
g++ -MM $(CXXFLAGS) $^ > $*.d
|
||||
@mv -f $*.d $*.d.tmp
|
||||
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
|
||||
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
|
||||
sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
|
||||
@rm -f $*.d.tmp
|
||||
-include *.d
|
||||
-include apple/*.d
|
||||
-include nix/*.d
|
||||
-include sdl/*.d
|
||||
|
||||
%.o: %.cpp
|
||||
g++ $(CXXFLAGS) -MMD -MP -c $< -o $@
|
||||
|
Loading…
x
Reference in New Issue
Block a user