Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7f881cd8 in mainline


Ignore:
Timestamp:
2017-11-06T21:04:24Z (3 years ago)
Author:
jzr <zarevucky.jiri@…>
Branches:
master
Children:
68825c3
Parents:
bd92e6d5
Message:

Simplify make precheck.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.build

    rbd92e6d5 r7f881cd8  
    9292        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $(LINK).in | grep -v "^\#" > $(LINK)
    9393
     94%.o: %.s | depend
     95        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__
     96
    9497%.o: %.S | depend
    95         $(CC) -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    96 ifeq ($(PRECHECK),y)
    97         $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
    98 endif
     98        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__
    9999
    100100%.o: %.c | depend
    101         $(CC) -MD $(DEFS) $(CFLAGS) -c $< -o $@
    102 ifeq ($(PRECHECK),y)
    103         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
    104 endif
    105 
    106 %.o: %.s | depend
    107         $(CC) -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    108 ifeq ($(PRECHECK),y)
    109         $(JOBFILE) $(JOB) $< $@ as asm
    110 endif
     101        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS)
    111102
    112103depend: $(PRE_DEPEND)
  • boot/Makefile.common

    rbd92e6d5 r7f881cd8  
    5757MKUIMAGE = $(TOOLS_PATH)/mkuimage.py
    5858
    59 JOBFILE = $(ROOT_PATH)/tools/jobfile.py
     59ifeq ($(PRECHECK),y)
     60        JOBFILE = $(TOOLS_PATH)/jobfile.py
     61        # XXX: Do not change the order of arguments.
     62        CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
     63else
     64        CC_JOB = $(CC) $< -o $@
     65endif
    6066
    6167DISTROOT = distroot
  • kernel/Makefile

    rbd92e6d5 r7f881cd8  
    5959
    6060GENMAP = tools/genmap.py
    61 JOBFILE = $(ROOT_PATH)/tools/jobfile.py
    6261
    6362LINK = arch/$(KARCH)/_link.ld
    6463EMPTY_MAP = generic/src/debug/empty_map.o
    6564SIZEOK_MAP = generic/src/debug/sizeok_map.o
     65
     66ifeq ($(PRECHECK),y)
     67        JOBFILE = $(ROOT_PATH)/tools/jobfile.py
     68        # XXX: Do not change the order of arguments.
     69        CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
     70else
     71        CC_JOB = $(CC) $< -o $@
     72endif
    6673
    6774.PHONY: all clean autogen_clean depend
     
    407414
    408415%.o: %.S | depend
    409         $(CC) -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $<
    410 ifeq ($(PRECHECK),y)
    411         $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
    412 endif
     416        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__
    413417
    414418%.o: %.s | depend
    415         $(CC) -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $<
    416 ifeq ($(PRECHECK),y)
    417         $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS)
    418 endif
     419        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__
    419420
    420421%.o: %.c | depend
    421         $(CC) -MD $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) $(if $(findstring $<,$(INSTRUMENTED_SOURCES)),$(INSTRUMENTATION)) -c -o $@ $<
    422 ifeq ($(PRECHECK),y)
    423         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS)
    424 endif
     422        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) $(if $(findstring $<,$(INSTRUMENTED_SOURCES)),$(INSTRUMENTATION))
    425423
    426424$(REAL_MAP).o: $(REAL_MAP).bin
  • tools/jobfile.py

    rbd92e6d5 r7f881cd8  
    3838def usage(prname):
    3939        "Print usage syntax"
    40         print(prname + " <JOBFILE> <SOURCE> <TARGET> <TOOL> <CATEGORY> [OPTIONS ...]")
     40        print(prname + " <JOBFILE> <CC> <INPUT> -o <OUTPUT> [CC_ARGUMENTS ...]")
    4141
    4242def main():
     
    4646       
    4747        jobfname = sys.argv[1]
    48         srcfname = sys.argv[2]
    49         tgtfname = sys.argv[3]
    50         toolname = sys.argv[4]
    51         category = sys.argv[5]
     48        ccname = sys.argv[2]
     49        srcfname = sys.argv[3]
     50        assert(not srcfname.startswith("-"))
     51        assert(sys.argv[4] == "-o")
     52        tgtfname = sys.argv[5]
     53        options = " ".join(sys.argv[6:])
    5254        cwd = os.getcwd()
    53         options = " ".join(sys.argv[6:])
     55       
     56        if srcfname.endswith(".c"):
     57                toolname = "cc"
     58                category = "core"
     59       
     60        if srcfname.endswith(".s"):
     61                toolname = "as"
     62                category = "asm"
     63       
     64        if srcfname.endswith(".S"):
     65                toolname = "as"
     66                category = "asm/preproc"
    5467       
    5568        jobfile = open(jobfname, "a")
     
    5871        fcntl.lockf(jobfile, fcntl.LOCK_UN)
    5972        jobfile.close()
     73       
     74        # Run the compiler proper.
     75        os.execvp(ccname, sys.argv[2:])
    6076
    6177if __name__ == '__main__':
  • uspace/Makefile.common

    rbd92e6d5 r7f881cd8  
    272272#
    273273
    274 JOBFILE = $(LIBC_PREFIX)/../../../tools/jobfile.py
     274ifeq ($(PRECHECK),y)
     275        JOBFILE = $(LIBC_PREFIX)/../../../tools/jobfile.py
     276        # XXX: Do not change the order of arguments.
     277        CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
     278else
     279        CC_JOB = $(CC) $< -o $@
     280endif
    275281
    276282ifeq ($(COMPILER),clang)
     
    336342
    337343%.o: %.S | depend
    338         $(CC) -MD $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    339 ifeq ($(PRECHECK),y)
    340         $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
    341 endif
     344        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__
    342345
    343346%.o: %.s | depend
    344         $(CC) -MD $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    345 ifeq ($(PRECHECK),y)
    346         $(JOBFILE) $(JOB) $< $@ as asm
    347 endif
     347        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__
    348348
    349349%.o: %.c | depend
    350         $(CC) -MD $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
    351 ifeq ($(PRECHECK),y)
    352         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS)
    353 endif
     350        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS)
    354351
    355352%.test.o: %.c | depend
    356         $(CC) -MD $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(TEST_CFLAGS) -c $< -o $@
    357 ifeq ($(PRECHECK),y)
    358         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(TEST_CFLAGS)
    359 endif
     353        $(CC_JOB) -c -MD $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(TEST_CFLAGS)
    360354
    361355%.lo: %.S | depend
    362         $(CC) -MD $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    363 ifeq ($(PRECHECK),y)
    364         $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
    365 endif
     356        $(CC_JOB) -c -MD $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__
    366357
    367358%.lo: %.s | depend
    368         $(CC) -MD $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    369 ifeq ($(PRECHECK),y)
    370         $(JOBFILE) $(JOB) $< $@ as asm
    371 endif
     359        $(CC_JOB) -c -MD $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__
    372360
    373361%.lo: %.c | depend
    374         $(CC) -MD $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
    375 ifeq ($(PRECHECK),y)
    376         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS)
    377 endif
     362        $(CC_JOB) -c -MD $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS)
    378363
    379364depend: $(PRE_DEPEND)
Note: See TracChangeset for help on using the changeset viewer.