Skip to content

Commit

Permalink
build: Add checking .pyc before moving (#32)
Browse files Browse the repository at this point in the history
A .pyc is created under __pycache__ after python 3.2. So it is needed to
check whether the file is under the __pycache.

Signed-off-by: Jungsu Sohn <jsson98@gmail.com>
  • Loading branch information
johnlukeabe authored and iipeace committed Oct 15, 2018
1 parent d4bdcef commit d654438
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion guider/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ all: $(TARGET_PYC) $(OBJS) $(TARGET_LIB)

$(TARGET_PYC): $(TARGET_PY)
$(QUIET_PCC)$(PCC) $(PFLAGS) $^
$(Q)-$(MV) __pycache__/$(MODULE)*.pyc $(CURDIR)/$(MODULE).pyc
$(Q)if [ -f __pycache__/$(MODULE)*.pyc ]; then \
$(MV) __pycache__/$(MODULE)*.pyc $(CURDIR)/$(MODULE).pyc; \
fi

$(OBJS): $(SRCS)
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $^
Expand Down

0 comments on commit d654438

Please sign in to comment.